add php 8.5 support
This commit is contained in:
@@ -60,8 +60,9 @@ class Script
|
||||
* @param string $namespace Include namespace
|
||||
* @return static
|
||||
*/
|
||||
public function setScriptInclude($file, $namespace = null)
|
||||
public function setScriptInclude(string|ScriptInclude $file, string $namespace = '')
|
||||
{
|
||||
|
||||
if ($file instanceof ScriptInclude) {
|
||||
$scriptInclude = $file;
|
||||
} else {
|
||||
|
||||
@@ -21,12 +21,12 @@ class ScriptInclude
|
||||
/**
|
||||
* @var string $file File name
|
||||
*/
|
||||
protected $file = null;
|
||||
protected $file = '';
|
||||
|
||||
/**
|
||||
* @var string $namespace Namespace
|
||||
*/
|
||||
protected $namespace = null;
|
||||
protected $namespace = '';
|
||||
|
||||
/**
|
||||
* Construct a new Script Include
|
||||
@@ -35,14 +35,10 @@ class ScriptInclude
|
||||
* @param string $file (optional) File name
|
||||
* @param string $namespace (optional) Namespace
|
||||
*/
|
||||
public function __construct($file = null, $namespace = null)
|
||||
public function __construct(string $file = '', string $namespace = '')
|
||||
{
|
||||
if ($file) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if ($namespace) {
|
||||
$this->setNamespace($namespace);
|
||||
}
|
||||
$this->setFile($file);
|
||||
$this->setNamespace($namespace);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,7 @@ class Connection
|
||||
|
||||
/** @var int[] */
|
||||
private static $levels = [
|
||||
null => -1,
|
||||
'' => -1,
|
||||
'User' => 0,
|
||||
'Admin' => 1,
|
||||
'SuperAdmin' => 2
|
||||
@@ -60,7 +60,7 @@ class Connection
|
||||
if (!is_string($user) || !isset(self::$levels[$user])) {
|
||||
throw new InvalidArgumentException('user = ' . print_r($user, true));
|
||||
}
|
||||
if (self::$levels[$this->user] >= self::$levels[$user]) {
|
||||
if ($this->user !== null && self::$levels[$this->user] >= self::$levels[$user]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -180,11 +180,11 @@ if (extension_loaded('xmlrpc')) {
|
||||
return (bool)(int)$elt;
|
||||
case 'i4':
|
||||
case 'int':
|
||||
return (int)$elt;
|
||||
return (int) $elt;
|
||||
case 'double':
|
||||
return (double)$elt;
|
||||
return (float) $elt;
|
||||
case 'string':
|
||||
return (string)$elt;
|
||||
return (string) $elt;
|
||||
case 'base64':
|
||||
return new Base64(base64_decode($elt));
|
||||
case 'dateTime.iso8601':
|
||||
|
||||
@@ -99,7 +99,11 @@ class Request extends EventDispatcher implements RequestInterface
|
||||
*/
|
||||
public function __destruct() {
|
||||
if (isset($this->ch)) {
|
||||
curl_close($this->ch);
|
||||
if (PHP_VERSION_ID >= 80000) {
|
||||
unset($this->ch);
|
||||
} else {
|
||||
curl_close($this->ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user