2
0
forked from Wavyzz/dolibarr

Fix phpcs

This commit is contained in:
Laurent Destailleur
2023-12-04 10:23:11 +01:00
parent b282251fbc
commit 23c6b59818
3 changed files with 22 additions and 18 deletions

View File

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