The expression self::enabled() of type null|boolean is loosely compared to false; this is ambiguous if the boolean can be false. You might want to explicitly use !== null instead.
If an expression can have both false, and null as possible values. It
is generally a good practice to always use strict comparison to clearly
distinguish between those two values.
$a=canBeFalseAndNull();// Instead ofif(!$a){}// Better use one of the explicit versions:if($a!==null){}if($a!==false){}if($a!==null&&$a!==false){}
It seems like self::$name can also be of type false; however, Apps\ActiveRecord\App::getItem() does only seem to accept string|array, did you maybe forget to handle an error condition?
Loading history...
45
// widget is not founded, deny run
46
if ($wData === null) {
47
if (App::$Debug !== null) {
48
App::$Debug->addMessage(__('Widget with name %name%[%class%] is not found', ['name' => self::$name, 'class' => self::$class]));
If an expression can have both
false
, andnull
as possible values. It is generally a good practice to always use strict comparison to clearly distinguish between those two values.