Skip to content

Commit

Permalink
Fix PHPCS errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 29, 2015
1 parent 10e8c98 commit b680b4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/Event/EventManager.php
Expand Up @@ -149,7 +149,8 @@ public function attach($callable, $eventKey = null, array $options = [])
* @throws \InvalidArgumentException When event key is missing or callable is not an
* instance of Cake\Event\EventListenerInterface.
*/
public function on($eventKey = null, $options = [], $callable = null) {
public function on($eventKey = null, $options = [], $callable = null)
{
if ($eventKey instanceof EventListenerInterface) {
$this->_attachSubscriber($eventKey);
return;
Expand Down Expand Up @@ -252,8 +253,8 @@ public function detach($callable, $eventKey = null)
/**
* Removes a listener from the active listeners.
*
* @param string|\Cake\Event\EventListenerInterface $eventKey The event unique identifier name
* with which the callback has been associated, or the $listener you want to remove.
* @param string|\Cake\Event\EventListenerInterface $eventKey The event unique identifier name
* with which the callback has been associated, or the $listener you want to remove.
* @param callback $callable The callback you want to detach.
* @return void
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Event/EventManagerTest.php
Expand Up @@ -191,7 +191,7 @@ public function testOff()
$manager = new EventManager();
$manager->on('fake.event', ['AClass', 'aMethod']);
$manager->on('another.event', ['AClass', 'anotherMethod']);
$manager->on('another.event', ['priority' => 1], 'fakeFunction');
$manager->on('another.event', ['priority' => 1], 'fakeFunction');

$manager->off('fake.event', ['AClass', 'aMethod']);
$this->assertEquals([], $manager->listeners('fake.event'));
Expand All @@ -216,7 +216,7 @@ public function testOffFromAll()
$manager = new EventManager();
$manager->on('fake.event', ['AClass', 'aMethod']);
$manager->on('another.event', ['AClass', 'aMethod']);
$manager->on('another.event', ['priority' => 1], 'fakeFunction');
$manager->on('another.event', ['priority' => 1], 'fakeFunction');

$manager->off(['AClass', 'aMethod']);
$expected = [
Expand Down

0 comments on commit b680b4a

Please sign in to comment.