cherry pick maniaplanet lib 6.1
This commit is contained in:
@ -27,7 +27,7 @@ class ServerOptions extends AbstractStructure
|
||||
* @internal
|
||||
* @return bool
|
||||
*/
|
||||
function isValid()
|
||||
public function isValid(): bool
|
||||
{
|
||||
return is_string($this->name)
|
||||
&& is_string($this->comment)
|
||||
@ -41,15 +41,16 @@ class ServerOptions extends AbstractStructure
|
||||
* @internal
|
||||
* @return mixed[]
|
||||
*/
|
||||
function toSetterArray()
|
||||
public function toSetterArray()
|
||||
{
|
||||
$out = array();
|
||||
foreach(get_object_vars($this) as $key => $value)
|
||||
{
|
||||
if(substr($key, 0, 7) == 'current' || $value === null)
|
||||
$out = [];
|
||||
foreach (get_object_vars($this) as $key => $value) {
|
||||
if (str_starts_with($key, 'current') || $value === null) {
|
||||
continue;
|
||||
if($key == 'nextUseChangingValidationSeed')
|
||||
}
|
||||
if ($key === 'nextUseChangingValidationSeed') {
|
||||
$key = 'useChangingValidationSeed';
|
||||
}
|
||||
$out[ucfirst($key)] = $value;
|
||||
}
|
||||
return $out;
|
||||
|
Reference in New Issue
Block a user