Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert Event::$_result to Event::$result.
Removing the public property is a regression caused by #9376 which breaks existing apps/plugins.
  • Loading branch information
ADmad committed Feb 22, 2017
1 parent 39ec5b7 commit 9947871
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Event/Event.php
Expand Up @@ -53,7 +53,7 @@ class Event
*
* @var mixed
*/
protected $_result = null;
public $result = null;

/**
* Flags an event as stopped or not, default is false
Expand Down Expand Up @@ -99,7 +99,7 @@ public function __get($attribute)
return $this->_data;
}
if ($attribute === 'result') {
return $this->_result;
return $this->result;
}
}

Expand All @@ -117,7 +117,7 @@ public function __set($attribute, $value)
$this->_data = (array)$value;
}
if ($attribute === 'result') {
$this->_result = $value;
$this->result = $value;
}
}

Expand Down Expand Up @@ -191,7 +191,7 @@ public function isStopped()
*/
public function result()
{
return $this->_result;
return $this->result;
}

/**
Expand All @@ -201,7 +201,7 @@ public function result()
*/
public function getResult()
{
return $this->_result;
return $this->result;
}

/**
Expand All @@ -212,7 +212,7 @@ public function getResult()
*/
public function setResult($value = null)
{
$this->_result = $value;
$this->result = $value;

return $this;
}
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Event/EventManagerTest.php
Expand Up @@ -422,6 +422,7 @@ public function testDispatchReturnValue()
->with($event);
$manager->dispatch($event);
$this->assertEquals('something special', $event->result());
$this->assertEquals('something special', $event->result);
}

/**
Expand Down

0 comments on commit 9947871

Please sign in to comment.