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