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;
}