public function matchesSubject(PrivilegeSubjectInterface $subject)
{
if ($subject instanceof MethodPrivilegeSubject === false) {
throw new InvalidPrivilegeTypeException(sprintf('Privileges of type "%s" only support subjects of type "%s", but we got a subject of type: "%s".', MethodPrivilegeInterface::class, MethodPrivilegeSubject::class, get_class($subject)), 1416241148);
}
$this->initialize();
$joinPoint = $subject->getJoinPoint();
$methodIdentifier = strtolower($joinPoint->getClassName() . '->' . $joinPoint->getMethodName());
if (isset(static::$methodPermissions[$methodIdentifier][$this->getCacheEntryIdentifier()])) {
if (static::$methodPermissions[$methodIdentifier][$this->getCacheEntryIdentifier()]['hasRuntimeEvaluations']) {
if ($this->runtimeExpressionEvaluator->evaluate($this->getCacheEntryIdentifier(), $joinPoint) === false) {
return false;
}
}
return true;
}
return false;
}