Пример #1
0
 public function testPassNoCallable()
 {
     $this->expectArgumentError('Argument 1 passed to Functional\\memoize() must be callable');
     memoize('invalidFunction');
 }
Пример #2
0
 public static function of(string $shortName) : State
 {
     return memoize(function ($n) {
         return static::query()->where('short_name', '=', $n)->first();
     }, [$shortName]);
 }