/** * Returns hooks for a specific event. * * @param HookScope $scope * * @return Hook[] */ public function getScopeHooks(HookScope $scope) { return array_filter($this->getEnvironmentHooks($scope->getEnvironment()), function (Hook $hook) use($scope) { if ($scope->getName() !== $hook->getScopeName()) { return false; } return !($hook instanceof FilterableHook && !$hook->filterMatches($scope)); }); }
/** * Initializes hook call. * * @param HookScope $scope * @param Hook $hook * @param null|integer $errorReportingLevel */ public function __construct(HookScope $scope, Hook $hook, $errorReportingLevel = null) { parent::__construct($scope->getEnvironment(), $hook, array($scope), $errorReportingLevel); $this->scope = $scope; }