mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +00:00
php-cs-fixer: added binary_operator_spaces and unary_operator_spaces rules
This commit is contained in:
parent
a09817864b
commit
7fb1669c6d
@ -19,6 +19,9 @@ return (new PhpCsFixer\Config)
|
||||
'array_syntax' => [
|
||||
'syntax' => 'short'
|
||||
],
|
||||
'binary_operator_spaces' => [
|
||||
'default' => 'single_space'
|
||||
],
|
||||
'blank_line_after_namespace' => true,
|
||||
'blank_line_after_opening_tag' => true,
|
||||
'blank_line_before_statement' => [
|
||||
@ -74,6 +77,7 @@ return (new PhpCsFixer\Config)
|
||||
],
|
||||
'single_import_per_statement' => true,
|
||||
'strict_param' => true,
|
||||
'unary_operator_spaces' => true,
|
||||
])
|
||||
->setFinder($finder)
|
||||
->setIndent("\t")
|
||||
|
@ -108,9 +108,9 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
*/
|
||||
public function setFlag(int $flag, bool $value){
|
||||
if(($flag & self::BITFLAG_SECOND_SET) !== 0){
|
||||
$flagSet =& $this->flags2;
|
||||
$flagSet = &$this->flags2;
|
||||
}else{
|
||||
$flagSet =& $this->flags;
|
||||
$flagSet = &$this->flags;
|
||||
}
|
||||
|
||||
if($value){
|
||||
|
@ -368,14 +368,14 @@ class Config{
|
||||
$this->config[$base] = [];
|
||||
}
|
||||
|
||||
$base =& $this->config[$base];
|
||||
$base = &$this->config[$base];
|
||||
|
||||
while(count($vars) > 0){
|
||||
$baseKey = array_shift($vars);
|
||||
if(!isset($base[$baseKey])){
|
||||
$base[$baseKey] = [];
|
||||
}
|
||||
$base =& $base[$baseKey];
|
||||
$base = &$base[$baseKey];
|
||||
}
|
||||
|
||||
$base = $value;
|
||||
@ -420,14 +420,14 @@ class Config{
|
||||
|
||||
$vars = explode(".", $key);
|
||||
|
||||
$currentNode =& $this->config;
|
||||
$currentNode = &$this->config;
|
||||
while(count($vars) > 0){
|
||||
$nodeName = array_shift($vars);
|
||||
if(isset($currentNode[$nodeName])){
|
||||
if(count($vars) === 0){ //final node
|
||||
unset($currentNode[$nodeName]);
|
||||
}elseif(is_array($currentNode[$nodeName])){
|
||||
$currentNode =& $currentNode[$nodeName];
|
||||
$currentNode = &$currentNode[$nodeName];
|
||||
}
|
||||
}else{
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user