59 if ( !is_callable( $callable,
false, $this->callableName ) ) {
60 throw new InvalidArgumentException(
61 'Argument 1 passed to MemoizedCallable::__construct() must ' .
62 'be an instance of callable; ' . get_debug_type( $callable ) .
' given'
66 if ( $this->callableName ===
'Closure::__invoke' ) {
67 throw new InvalidArgumentException(
'Cannot memoize unnamed closure' );
70 $this->callable = $callable;
71 $this->ttl = min( max( $ttl, 1 ), 86400 );