Skip to content

Commit 9947871

Browse files
committed
Revert Event::$_result to Event::$result.
Removing the public property is a regression caused by #9376 which breaks existing apps/plugins.
1 parent 39ec5b7 commit 9947871

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Event/Event.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Event
5353
*
5454
* @var mixed
5555
*/
56-
protected $_result = null;
56+
public $result = null;
5757

5858
/**
5959
* Flags an event as stopped or not, default is false
@@ -99,7 +99,7 @@ public function __get($attribute)
9999
return $this->_data;
100100
}
101101
if ($attribute === 'result') {
102-
return $this->_result;
102+
return $this->result;
103103
}
104104
}
105105

@@ -117,7 +117,7 @@ public function __set($attribute, $value)
117117
$this->_data = (array)$value;
118118
}
119119
if ($attribute === 'result') {
120-
$this->_result = $value;
120+
$this->result = $value;
121121
}
122122
}
123123

@@ -191,7 +191,7 @@ public function isStopped()
191191
*/
192192
public function result()
193193
{
194-
return $this->_result;
194+
return $this->result;
195195
}
196196

197197
/**
@@ -201,7 +201,7 @@ public function result()
201201
*/
202202
public function getResult()
203203
{
204-
return $this->_result;
204+
return $this->result;
205205
}
206206

207207
/**
@@ -212,7 +212,7 @@ public function getResult()
212212
*/
213213
public function setResult($value = null)
214214
{
215-
$this->_result = $value;
215+
$this->result = $value;
216216

217217
return $this;
218218
}

tests/TestCase/Event/EventManagerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ public function testDispatchReturnValue()
422422
->with($event);
423423
$manager->dispatch($event);
424424
$this->assertEquals('something special', $event->result());
425+
$this->assertEquals('something special', $event->result);
425426
}
426427

427428
/**

0 commit comments

Comments
 (0)