It seems like $title defined by $semanticData->getSubject()->getTitle() on line 59 can be null; however, SESP\AppFactory::newUserFromTitle() does not accept null, maybe add an additional type check?
Unless you are absolutely sure that the expression can never be null because of
other conditions, we strongly recommend to add an additional type check to your
code:
/** @return stdClass|null */functionmayReturnNull(){}functiondoesNotAcceptNull(stdClass$x){}// With potential error.functionwithoutCheck(){$x=mayReturnNull();doesNotAcceptNull($x);// Potential error here.}// Safe - Alternative 1functionwithCheck1(){$x=mayReturnNull();if(!$xinstanceofstdClass){thrownew\LogicException('$x must be defined.');}doesNotAcceptNull($x);}// Safe - Alternative 2functionwithCheck2(){$x=mayReturnNull();if($xinstanceofstdClass){doesNotAcceptNull($x);}}
Loading history...
67
6
);
68
69
6
if ( !$user instanceof User || ( $block = $user->getBlock() ) === null ) {
The class User does not exist. Is this class maybe located in a folder that is not analyzed, or in a newer version of your dependencies than listed in your composer.lock/composer.json?
Loading history...
70
return;
71
}
72
73
$actions = [
74
6
'edit',
75
6
'createaccount',
76
6
'sendemail',
77
6
'editownusertalk',
78
'read'
79
6
];
80
81
6
foreach ( $actions as $action ) {
82
6
if ( $block->prevents( $action ) ) {
83
5
$semanticData->addPropertyObjectValue( $property, new DIBlob( $action ) );
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: