Replace is_null with "=== null" comparison
This commit is contained in:
parent
77b6f07291
commit
a3d7a028b4
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class ControllerBehavior extends ExtensionBase
|
|||
/*
|
||||
* Return all config
|
||||
*/
|
||||
if (is_null($name)) {
|
||||
if ($name === null) {
|
||||
return $this->config;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ class FormField
|
|||
*/
|
||||
protected function evalConfig($config)
|
||||
{
|
||||
if (is_null($config)) {
|
||||
if ($config === null) {
|
||||
$config = [];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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 = [
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class MarkupManager
|
|||
{
|
||||
$items = $this->transactionMode ? 'transactionItems' : 'items';
|
||||
|
||||
if (is_null($this->$items)) {
|
||||
if ($this->$items === null) {
|
||||
$this->$items = [];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue