Browse Source

Throw deprecation warning only for properties declared in Event class.

ADmad 8 years ago
parent
commit
d6f9681325
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Event/Event.php

+ 4 - 0
src/Event/Event.php

@@ -84,6 +84,10 @@ class Event implements EventInterface
      */
     public function __get($attribute)
     {
+        if (!in_array($attribute, ['name', 'subject', 'data', 'result'])) {
+            return $this->{$attribute};
+        }
+        
         $method = 'get' . ucfirst($attribute);
         deprecationWarning(
             "Event::\${$attribute} is deprecated. " .