add php 8.5 support
This commit is contained in:
@@ -109,7 +109,7 @@ class ScriptManager implements UsageInformationAble {
|
|||||||
* @param boolean $status
|
* @param boolean $status
|
||||||
*/
|
*/
|
||||||
private function setPauseStatus($status) {
|
private function setPauseStatus($status) {
|
||||||
$status = (boolean) $status;
|
$status = (bool) $status;
|
||||||
if ($this->modeUsesPause != $status) {
|
if ($this->modeUsesPause != $status) {
|
||||||
$this->modeUsesPause = $status;
|
$this->modeUsesPause = $status;
|
||||||
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_PAUSE_STATUS_CHANGED, $status);
|
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_PAUSE_STATUS_CHANGED, $status);
|
||||||
|
|||||||
@@ -60,8 +60,9 @@ class Script
|
|||||||
* @param string $namespace Include namespace
|
* @param string $namespace Include namespace
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function setScriptInclude($file, $namespace = null)
|
public function setScriptInclude(string|ScriptInclude $file, string $namespace = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($file instanceof ScriptInclude) {
|
if ($file instanceof ScriptInclude) {
|
||||||
$scriptInclude = $file;
|
$scriptInclude = $file;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ class ScriptInclude
|
|||||||
/**
|
/**
|
||||||
* @var string $file File name
|
* @var string $file File name
|
||||||
*/
|
*/
|
||||||
protected $file = null;
|
protected $file = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $namespace Namespace
|
* @var string $namespace Namespace
|
||||||
*/
|
*/
|
||||||
protected $namespace = null;
|
protected $namespace = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new Script Include
|
* Construct a new Script Include
|
||||||
@@ -35,15 +35,11 @@ class ScriptInclude
|
|||||||
* @param string $file (optional) File name
|
* @param string $file (optional) File name
|
||||||
* @param string $namespace (optional) Namespace
|
* @param string $namespace (optional) Namespace
|
||||||
*/
|
*/
|
||||||
public function __construct($file = null, $namespace = null)
|
public function __construct(string $file = '', string $namespace = '')
|
||||||
{
|
{
|
||||||
if ($file) {
|
|
||||||
$this->setFile($file);
|
$this->setFile($file);
|
||||||
}
|
|
||||||
if ($namespace) {
|
|
||||||
$this->setNamespace($namespace);
|
$this->setNamespace($namespace);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the file
|
* Get the file
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class Connection
|
|||||||
|
|
||||||
/** @var int[] */
|
/** @var int[] */
|
||||||
private static $levels = [
|
private static $levels = [
|
||||||
null => -1,
|
'' => -1,
|
||||||
'User' => 0,
|
'User' => 0,
|
||||||
'Admin' => 1,
|
'Admin' => 1,
|
||||||
'SuperAdmin' => 2
|
'SuperAdmin' => 2
|
||||||
@@ -60,7 +60,7 @@ class Connection
|
|||||||
if (!is_string($user) || !isset(self::$levels[$user])) {
|
if (!is_string($user) || !isset(self::$levels[$user])) {
|
||||||
throw new InvalidArgumentException('user = ' . print_r($user, true));
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ if (extension_loaded('xmlrpc')) {
|
|||||||
case 'int':
|
case 'int':
|
||||||
return (int) $elt;
|
return (int) $elt;
|
||||||
case 'double':
|
case 'double':
|
||||||
return (double)$elt;
|
return (float) $elt;
|
||||||
case 'string':
|
case 'string':
|
||||||
return (string) $elt;
|
return (string) $elt;
|
||||||
case 'base64':
|
case 'base64':
|
||||||
|
|||||||
@@ -99,9 +99,13 @@ class Request extends EventDispatcher implements RequestInterface
|
|||||||
*/
|
*/
|
||||||
public function __destruct() {
|
public function __destruct() {
|
||||||
if (isset($this->ch)) {
|
if (isset($this->ch)) {
|
||||||
|
if (PHP_VERSION_ID >= 80000) {
|
||||||
|
unset($this->ch);
|
||||||
|
} else {
|
||||||
curl_close($this->ch);
|
curl_close($this->ch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns cURL raw resource
|
* Returns cURL raw resource
|
||||||
|
|||||||
Reference in New Issue
Block a user