Skip to content

Commit

Permalink
swap returns
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkingmedia committed Oct 28, 2016
1 parent b1cf698 commit 7b673e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Controller/Component.php
Expand Up @@ -154,11 +154,11 @@ public function __get($name)
$config = (array)$this->_componentMap[$name]['config'] + ['enabled' => false];
$this->{$name} = $this->_registry->load($this->_componentMap[$name]['class'], $config);
}
if (isset($this->{$name})) {
return $this->{$name};
if (!isset($this->{$name})) {
return null;
}

return null;
return $this->{$name};
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Controller/ComponentTest.php
Expand Up @@ -13,18 +13,18 @@
*/
namespace Cake\Test\TestCase\Controller;

use Cake\Controller\Component\CookieComponent;
use Cake\Controller\ComponentRegistry;
use Cake\Controller\Component\CookieComponent;
use Cake\Controller\Controller;
use Cake\Core\Configure;
use Cake\Event\EventManager;
use Cake\TestSuite\TestCase;
use TestApp\Controller\ComponentTestController;
use TestApp\Controller\Component\AppleComponent;
use TestApp\Controller\Component\BananaComponent;
use TestApp\Controller\Component\ConfiguredComponent;
use TestApp\Controller\Component\OrangeComponent;
use TestApp\Controller\Component\SomethingWithCookieComponent;
use TestApp\Controller\ComponentTestController;

/**
* ComponentTest class
Expand Down

0 comments on commit 7b673e4

Please sign in to comment.