Fix some PHPstan warnings for PHP 8 support
This commit is contained in:
parent
8c108d0ebb
commit
8321c1cdd2
4 changed files with 8 additions and 2 deletions
|
@ -9,7 +9,7 @@ error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
|
|||
|
||||
// Root directory path
|
||||
$script = null;
|
||||
if (defined('__FILE__') && constant('__FILE__')) {
|
||||
if (defined('__FILE__') && constant('__FILE__')) { // @phpstan-ignore-line
|
||||
$script = __FILE__;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -8,7 +8,7 @@ error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
|
|||
|
||||
// Root directory path
|
||||
$script = null;
|
||||
if (defined('__FILE__') && constant('__FILE__')) {
|
||||
if (defined('__FILE__') && constant('__FILE__')) { // @phpstan-ignore-line
|
||||
$script = __FILE__;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -23,6 +23,11 @@ class HookEvent implements JsonSerializable {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return data to serialize a HookEvent object as JSON
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize() {
|
||||
return array (
|
||||
'name' => $this -> name,
|
||||
|
|
|
@ -21,6 +21,7 @@ class Session {
|
|||
// In CLI or Phpstan context, do not initialize
|
||||
if (
|
||||
php_sapi_name() == "cli"
|
||||
// @phpstan-ignore-next-line
|
||||
|| (defined('__PHPSTAN_RUNNING__') && constant('__PHPSTAN_RUNNING__'))
|
||||
)
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue