public function isActive($subject, \ArrayAccess $context, EventInterface $event = null) { if ($event) { $result = $event->getName() == $this->eventName; } else { $result = is_null($this->eventName); } if ($this->condition) { $result = $result && $this->condition->checkCondition($subject, $context); } return $result; }