storyblok-php-client
storyblok-php-client copied to clipboard
Adding Rector: Dead Code, Code quality, Coding Style, Type Declarations, Early return
Introducing Rector and updating the code for:
- Dead Code;
- Code quality;
- Coding Style;
- Type Declarations
- Early return
- Updating old PHP code (in order to use at least the PHP 7.3 , at the moment the oldest PHP version supported by Storyblok PHP client)
The configurarion:
->withPhpSets(php73: true)
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
earlyReturn: true
);
Running all tests are still green
Hi @RicLeP i see your comments, thank you! So are you suggesting to avoid yoda style, so i can set in the PHP cs fixer configuration :
'yoda_style' => [
'always_move_variable' => false,
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],
What do you think ?
It’s a code style choice so not essential, however I think it’s usually recommended, but go with what you feel it best. :)
Since PSR-12 its not recommended to use yoda style due to less readability of the code. However i prefer yoda style as well :)