php-cs-fixer: added binary_operator_spaces and unary_operator_spaces rules

This commit is contained in:
Dylan K. Taylor 2021-12-14 23:14:39 +00:00
parent a09817864b
commit 7fb1669c6d
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
8 changed files with 30 additions and 26 deletions

View File

@ -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")

View File

@ -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){

View File

@ -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;