ZfcRbac\Service\AuthorizationService::assert PHP Method

assert() protected method

protected assert ( string | callable | ZfcRbac\Assertion\AssertionInterface $assertion, mixed $context = null ) : boolean
$assertion string | callable | ZfcRbac\Assertion\AssertionInterface
$context mixed
return boolean
    protected function assert($assertion, $context = null)
    {
        if (is_callable($assertion)) {
            return $assertion($this, $context);
        } elseif ($assertion instanceof AssertionInterface) {
            return $assertion->assert($this, $context);
        } elseif (is_string($assertion)) {
            $assertion = $this->assertionPluginManager->get($assertion);
            return $assertion->assert($this, $context);
        }
        throw new Exception\InvalidArgumentException(sprintf('Assertion must be callable, string or implement ZfcRbac\\Assertion\\AssertionInterface, "%s" given', is_object($assertion) ? get_class($assertion) : gettype($assertion)));
    }