Skip to content

Commit

Permalink
Remove some cloaking for stricter null checks and fix a doc block.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 25, 2016
1 parent 6673d00 commit f36de8a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Database/Query.php
Expand Up @@ -1605,7 +1605,7 @@ public function newExpr($rawExpression = null)
*/
public function func()
{
if (empty($this->_functionsBuilder)) {
if ($this->_functionsBuilder === null) {
$this->_functionsBuilder = new FunctionsBuilder();
}

Expand All @@ -1622,7 +1622,7 @@ public function func()
*/
public function getIterator()
{
if (empty($this->_iterator) || $this->_dirty) {
if ($this->_iterator === null || $this->_dirty) {
$this->_iterator = $this->execute();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Event/EventDispatcherTrait.php
Expand Up @@ -48,7 +48,7 @@ public function eventManager(EventManager $eventManager = null)
{
if ($eventManager !== null) {
$this->_eventManager = $eventManager;
} elseif (empty($this->_eventManager)) {
} elseif ($this->_eventManager === null) {
$this->_eventManager = new EventManager();
}

Expand Down
8 changes: 4 additions & 4 deletions src/Routing/Route/Route.php
Expand Up @@ -52,29 +52,29 @@ class Route
/**
* The routes template string.
*
* @var string
* @var string|null
*/
public $template = null;

/**
* Is this route a greedy route? Greedy routes have a `/*` in their
* template
*
* @var string
* @var bool
*/
protected $_greedy = false;

/**
* The compiled route regular expression
*
* @var string
* @var string|null
*/
protected $_compiledRoute = null;

/**
* The name for a route. Fetch with Route::getName();
*
* @var string
* @var string|null
*/
protected $_name = null;

Expand Down
4 changes: 2 additions & 2 deletions src/TestSuite/IntegrationTestCase.php
Expand Up @@ -945,7 +945,7 @@ public function assertSession($expected, $path, $message = '')
*/
public function assertCookie($expected, $name, $message = '')
{
if (empty($this->_response)) {
if (!$this->_response) {
$this->fail('Not response set, cannot assert cookies.');
}
$result = $this->_response->cookie($name);
Expand Down Expand Up @@ -990,7 +990,7 @@ public function assertCookieNotSet($cookie, $message = '')
*/
public function assertCookieEncrypted($expected, $name, $encrypt = 'aes', $key = null, $message = '')
{
if (empty($this->_response)) {
if (!$this->_response) {
$this->fail('No response set, cannot assert cookies.');
}
$result = $this->_response->cookie($name);
Expand Down
4 changes: 2 additions & 2 deletions src/TestSuite/TestCase.php
Expand Up @@ -35,7 +35,7 @@ abstract class TestCase extends PHPUnit_Framework_TestCase
/**
* The class responsible for managing the creation, loading and removing of fixtures
*
* @var \Cake\TestSuite\Fixture\FixtureManager
* @var \Cake\TestSuite\Fixture\FixtureManager|null
*/
public $fixtureManager = null;

Expand Down Expand Up @@ -134,7 +134,7 @@ public function tearDown()
*/
public function loadFixtures()
{
if (empty($this->fixtureManager)) {
if ($this->fixtureManager === null) {
throw new Exception('No fixture manager to load the test fixture');
}
$args = func_get_args();
Expand Down
2 changes: 1 addition & 1 deletion src/View/View.php
Expand Up @@ -334,7 +334,7 @@ public function __construct(
$this->eventManager($eventManager);
$this->request = $request ?: Router::getRequest(true);
$this->response = $response ?: new Response();
if (empty($this->request)) {
if ($this->request === null) {
$this->request = new ServerRequest([
'base' => '',
'url' => '',
Expand Down

0 comments on commit f36de8a

Please sign in to comment.