Browse Source

Merge pull request #11890 from cakephp/ADmad-patch-1

Throw deprecation warning only for properties declared in Event class.
Mark Story 8 years ago
parent
commit
44e2240bb9
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. " .