Skip to content

Commit

Permalink
Throw deprecation warning only for properties declared in Event class.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Apr 1, 2018
1 parent 6565302 commit d6f9681
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Event/Event.php
Expand Up @@ -84,6 +84,10 @@ public function __construct($name, $subject = null, $data = null)
*/
public function __get($attribute)
{
if (!in_array($attribute, ['name', 'subject', 'data', 'result'])) {
return $this->{$attribute};
}

$method = 'get' . ucfirst($attribute);
deprecationWarning(
"Event::\${$attribute} is deprecated. " .
Expand Down

0 comments on commit d6f9681

Please sign in to comment.