Skip to content
Permalink
Browse files

Remove some cloaking for stricter null checks and fix a doc block.

  • Loading branch information...
dereuromark committed Nov 23, 2016
1 parent 6673d00 commit f36de8a9bb178d406b89e6d68107f24967c95d02
@@ -1605,7 +1605,7 @@ public function newExpr($rawExpression = null)
*/
public function func()
{
if (empty($this->_functionsBuilder)) {
if ($this->_functionsBuilder === null) {
$this->_functionsBuilder = new FunctionsBuilder();
}
@@ -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();
}
@@ -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();
}
@@ -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;
@@ -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);
@@ -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);
@@ -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;
@@ -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();
@@ -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' => '',

0 comments on commit f36de8a

Please sign in to comment.
You can’t perform that action at this time.