public static function ensureCallback(&$arg)
{
if ($arg instanceof \Closure) {
return true;
}
if (is_array($arg) && sizeof($arg) === 2) {
if (isset($arg[0]) && $arg[0] instanceof \PHPDaemon\WebSocket\Route) {
if (isset($arg[1]) && is_string($arg[1]) && strncmp($arg[1], 'remote_', 7) === 0) {
return true;
}
}
}
$arg = null;
return false;
}