diff --git a/dev/tools/rector/src/Renaming/EmptyGlobalToFunction.php b/dev/tools/rector/src/Renaming/EmptyGlobalToFunction.php index 9af29f4fc1b..0bd1575adcd 100644 --- a/dev/tools/rector/src/Renaming/EmptyGlobalToFunction.php +++ b/dev/tools/rector/src/Renaming/EmptyGlobalToFunction.php @@ -53,9 +53,11 @@ class EmptyGlobalToFunction extends AbstractRector { return new RuleDefinition( 'Change $conf->global to getDolGlobal', - [new CodeSample('$conf->global->CONSTANT', + [new CodeSample( + '$conf->global->CONSTANT', 'getDolGlobalInt(\'CONSTANT\')' - )]); + )] + ); } /** @@ -106,7 +108,7 @@ class EmptyGlobalToFunction extends AbstractRector return new FuncCall( new Name('getDolGlobalString'), [new Arg($constName)] - ); + ); } @@ -136,7 +138,7 @@ class EmptyGlobalToFunction extends AbstractRector return new BooleanNot(new FuncCall( new Name('getDolGlobalString'), [new Arg($constName)] - )); + )); } return null; @@ -169,7 +171,7 @@ class EmptyGlobalToFunction extends AbstractRector } return \true; } - ); + ); } /** diff --git a/dev/tools/rector/src/Renaming/GlobalToFunction.php b/dev/tools/rector/src/Renaming/GlobalToFunction.php index 7cf89d24f4c..d20c2867cdb 100644 --- a/dev/tools/rector/src/Renaming/GlobalToFunction.php +++ b/dev/tools/rector/src/Renaming/GlobalToFunction.php @@ -56,9 +56,11 @@ class GlobalToFunction extends AbstractRector { return new RuleDefinition( 'Change $conf->global to getDolGlobal', - [new CodeSample('$conf->global->CONSTANT', + [new CodeSample( + '$conf->global->CONSTANT', 'getDolGlobalInt(\'CONSTANT\')' - )]); + )] + ); } /** @@ -188,36 +190,36 @@ class GlobalToFunction extends AbstractRector new FuncCall( new Name($funcName), [new Arg($constName)] - ), + ), $node->right - ); + ); } if ($typeofcomparison == 'GreaterOrEqual') { return new GreaterOrEqual( new FuncCall( new Name($funcName), [new Arg($constName)] - ), + ), $node->right - ); + ); } if ($typeofcomparison == 'Smaller') { return new Smaller( new FuncCall( new Name($funcName), [new Arg($constName)] - ), + ), $node->right - ); + ); } if ($typeofcomparison == 'SmallerOrEqual') { return new SmallerOrEqual( new FuncCall( new Name($funcName), [new Arg($constName)] - ), + ), $node->right - ); + ); } } diff --git a/dev/tools/rector/src/Renaming/UserRightsToFunction.php b/dev/tools/rector/src/Renaming/UserRightsToFunction.php index fbb8edfb594..dd93fbdc4d5 100644 --- a/dev/tools/rector/src/Renaming/UserRightsToFunction.php +++ b/dev/tools/rector/src/Renaming/UserRightsToFunction.php @@ -2,7 +2,6 @@ namespace Dolibarr\Rector\Renaming; - use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Scalar\String_; @@ -36,7 +35,8 @@ class UserRightsToFunction extends AbstractRector [new CodeSample( '$user->rights->module->permission', '$user->hasRight(\'module\', \'permission\')' - )]); + )] + ); } /** @@ -122,7 +122,7 @@ class UserRightsToFunction extends AbstractRector return null; } // Add a test to avoid rector error on html.formsetup.class.php - if (! $node->name instanceof Node\Expr\Variable && is_null($this->getName($node))) { + if (!$node->name instanceof Node\Expr\Variable && is_null($this->getName($node))) { //var_dump($node); return null; //exit;