The expression return empty($sNoScript)...e{' . $sNoScript . ';}' returns the type string which is incompatible with the return type mandated by Jaxon\App\Dialog\QuestionInterface::confirm() of array.
In the issue above, the returned value is violating the contract defined by the
mentioned interface.
Let's take a look at an example:
interfaceHasName{/** @return string */publicfunctiongetName();}className{public$name;}classUserimplementsHasName{/** @return string|Name */publicfunctiongetName(){returnnewName('foo');// This is a violation of the ``HasName`` interface// which only allows a string value to be returned.}}
The call to Jaxon\Response\Response::alert() has too many arguments starting with $sTitle.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
60
$this->xResponse->/** @scrutinizer ignore-call */
61
alert($sMessage, $sTitle);
This check compares calls to functions or methods with their respective definitions.
If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the
check may pick up the wrong definition and report false positives. One codebase
where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.