Skip to content

Commit 659cd12

Browse files
committed
Partially revert changes to Event.
The changes around the data property will have to wait until Components are also migrated to the new event style.
1 parent dd085fb commit 659cd12

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Cake/Event/Event.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Event {
4545
*
4646
* @var mixed $data
4747
*/
48-
protected $_data = null;
48+
public $data = null;
4949

5050
/**
5151
* Property used to retain the result value of the event listeners
@@ -77,7 +77,7 @@ class Event {
7777
*/
7878
public function __construct($name, $subject = null, $data = null) {
7979
$this->_name = $name;
80-
$this->_data = $data;
80+
$this->data = $data;
8181
$this->_subject = $subject;
8282
}
8383

@@ -88,7 +88,7 @@ public function __construct($name, $subject = null, $data = null) {
8888
* @return mixed
8989
*/
9090
public function __get($attribute) {
91-
if ($attribute === 'data' || $attribute === 'name' || $attribute === 'subject') {
91+
if ($attribute === 'name' || $attribute === 'subject') {
9292
return $this->{$attribute}();
9393
}
9494
}
@@ -135,7 +135,7 @@ public function isStopped() {
135135
* @return array
136136
*/
137137
public function data() {
138-
return (array)$this->_data;
138+
return (array)$this->data;
139139
}
140140

141141
}

0 commit comments

Comments
 (0)