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
|
// Root directory path
|
||||||
$script = null;
|
$script = null;
|
||||||
if (defined('__FILE__') && constant('__FILE__')) {
|
if (defined('__FILE__') && constant('__FILE__')) { // @phpstan-ignore-line
|
||||||
$script = __FILE__;
|
$script = __FILE__;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -8,7 +8,7 @@ error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
|
||||||
|
|
||||||
// Root directory path
|
// Root directory path
|
||||||
$script = null;
|
$script = null;
|
||||||
if (defined('__FILE__') && constant('__FILE__')) {
|
if (defined('__FILE__') && constant('__FILE__')) { // @phpstan-ignore-line
|
||||||
$script = __FILE__;
|
$script = __FILE__;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -23,6 +23,11 @@ class HookEvent implements JsonSerializable {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return data to serialize a HookEvent object as JSON
|
||||||
|
* @return array<string,mixed>
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function jsonSerialize() {
|
public function jsonSerialize() {
|
||||||
return array (
|
return array (
|
||||||
'name' => $this -> name,
|
'name' => $this -> name,
|
||||||
|
|
|
@ -21,6 +21,7 @@ class Session {
|
||||||
// In CLI or Phpstan context, do not initialize
|
// In CLI or Phpstan context, do not initialize
|
||||||
if (
|
if (
|
||||||
php_sapi_name() == "cli"
|
php_sapi_name() == "cli"
|
||||||
|
// @phpstan-ignore-next-line
|
||||||
|| (defined('__PHPSTAN_RUNNING__') && constant('__PHPSTAN_RUNNING__'))
|
|| (defined('__PHPSTAN_RUNNING__') && constant('__PHPSTAN_RUNNING__'))
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue