Nette\Utils\Callback::check PHP Method

check() public static method

public static check ( $callable, $syntax = FALSE ) : callable
return callable
    public static function check($callable, $syntax = FALSE)
    {
        if (!is_callable($callable, $syntax)) {
            throw new Nette\InvalidArgumentException($syntax ? 'Given value is not a callable type.' : sprintf("Callback '%s' is not callable.", self::toString($callable)));
        }
        return $callable;
    }

Usage Example

Esempio n. 1
0
 /**
  * @param string   $name
  * @param string   $caption
  * @param callable $callback
  */
 public function __construct($name, $caption, $callback)
 {
     $this->name = $name;
     $this->caption = $caption;
     Callback::check($callback);
     $this->callback = $callback;
 }
All Usage Examples Of Nette\Utils\Callback::check