FOF30\Pimple\Container::protect PHP Метод

protect() публичный Метод

This is useful when you want to store a callable as a parameter.
public protect ( callable $callable ) : callable
$callable callable A callable to protect from being evaluated
Результат callable The passed callable
    public function protect($callable)
    {
        if (!is_object($callable) || !method_exists($callable, '__invoke')) {
            throw new \InvalidArgumentException('Callable is not a Closure or invokable object.');
        }
        $this->protected->attach($callable);
        return $callable;
    }