Replace is_null with "=== null" comparison

This commit is contained in:
Nathan van der Werf 2018-08-15 18:54:46 +02:00
parent 77b6f07291
commit a3d7a028b4
11 changed files with 11 additions and 11 deletions

View File

@ -361,7 +361,7 @@ class Controller extends Extendable
}
// Load the view
if (!$this->suppressView && is_null($result)) {
if (!$this->suppressView && $result === null) {
return $this->makeView($actionName);
}

View File

@ -81,7 +81,7 @@ class ControllerBehavior extends ExtensionBase
/*
* Return all config
*/
if (is_null($name)) {
if ($name === null) {
return $this->config;
}

View File

@ -266,7 +266,7 @@ class FormField
*/
protected function evalConfig($config)
{
if (is_null($config)) {
if ($config === null) {
$config = [];
}

View File

@ -317,7 +317,7 @@ class NavigationManager
{
$activeItem = null;
if (!is_null($owner) && !is_null($code)) {
if ($owner !== null && $code !== null) {
$activeItem = @$this->items[$this->makeItemKey($owner, $code)];
} else {
foreach ($this->listMainMenuItems() as $item) {

View File

@ -75,7 +75,7 @@ class Auth extends Controller
throw new ValidationException($validation);
}
if (is_null($remember = config('cms.backendForceRemember', true))) {
if (($remember = config('cms.backendForceRemember', true)) === null) {
$remember = (bool) post('remember');
}

View File

@ -213,7 +213,7 @@ class RecordFinder extends FormWidgetBase
{
list($model, $attribute) = $this->resolveModelAttribute($this->valueFrom);
if (!is_null($model)) {
if ($model !== null) {
return $model->{$attribute};
}

View File

@ -263,7 +263,7 @@ class Filter extends WidgetBase
case 'text':
$values = post('options.value');
if (!is_null($values) && $values !== '') {
if ($values !== null && $values !== '') {
list($value) = $values;
}
else {

View File

@ -672,7 +672,7 @@ class Form extends WidgetBase
else {
$fieldType = isset($config['type']) ? $config['type'] : null;
if (!is_string($fieldType) && !is_null($fieldType)) {
if (!is_string($fieldType) && $fieldType !== null) {
throw new ApplicationException(Lang::get(
'backend::lang.field.invalid_type',
['type'=>gettype($fieldType)]

View File

@ -484,7 +484,7 @@ class Controller
$useCache = !Config::get('cms.twigNoCache');
$isDebugMode = Config::get('app.debug', false);
$strictVariables = Config::get('cms.enableTwigStrictVariables', false);
$strictVariables = is_null($strictVariables) ? $isDebugMode : $strictVariables;
$strictVariables = $strictVariables === null ? $isDebugMode : $strictVariables;
$forceBytecode = Config::get('cms.forceBytecodeInvalidation', false);
$options = [

View File

@ -115,7 +115,7 @@ class MarkupManager
{
$items = $this->transactionMode ? 'transactionItems' : 'items';
if (is_null($this->$items)) {
if ($this->$items === null) {
$this->$items = [];
}

View File

@ -266,7 +266,7 @@ class OctoberEnv extends Command
return "'$value'";
} elseif (is_bool($value)) {
return $value ? 'true' : 'false';
} elseif (is_null($value)) {
} elseif ($value === null) {
return 'null';
}