Skip to content

Instantly share code, notes, and snippets.

@gnutix
Last active November 1, 2019 15:58
Show Gist options
  • Save gnutix/4080142ecce07696035e19bdcb8c3d31 to your computer and use it in GitHub Desktop.
Save gnutix/4080142ecce07696035e19bdcb8c3d31 to your computer and use it in GitHub Desktop.
services:
Rector\CodingStyle\Rector\Namespace_\ImportFullyQualifiedNamesRector:
# Prevent importing classes like \DateTime
$shouldImportRootNamespaceClasses: false
parameters:
kernel_class: \App\Kernel
sets:
# Code quality
- 'celebrity'
- 'code-quality'
- 'coding-style'
- 'solid'
# This is very risky to run and currently has some bugs which are very hard to debug.
# https://github.com/rectorphp/rector/issues/1630
# - 'dead-code'
# Doctrine
- 'doctrine25'
# PHP
- 'php52'
- 'php53'
- 'php54'
- 'php55'
- 'php56'
- 'php70'
- 'php71'
- 'php72'
- 'php73'
# PHPUnit
- 'phpunit60'
- 'phpunit70'
- 'phpunit80'
- 'phpunit-code-quality'
- 'phpunit-exception'
- 'phpunit-mock'
- 'phpunit-specific-method'
- 'phpunit-yield-data-provider'
# Symfony
- 'symfony26'
- 'symfony28'
- 'symfony30'
- 'symfony31'
- 'symfony32'
- 'symfony33'
- 'symfony34'
- 'symfony40'
- 'symfony41'
- 'symfony42'
- 'symfony43'
- 'symfony-code-quality'
- 'symfony-constructor-injection'
# FrameworkBundle
- 'framework-extra-bundle-30'
- 'framework-extra-bundle-50'
# Twig
- 'twig112'
- 'twig127'
- 'twig134'
- 'twig140'
- 'twig20'
- 'twig240'
exclude_rectors:
# This tends to do changes that are hard to review and breaks code, so let's skip it. I couldn't get a failing
# test case to provide to Rector's developers, so I guess it'll be skipped "forever"...
- 'Rector\SOLID\Rector\ClassConst\PrivatizeLocalClassConstantRector'
# Prefer single quotes everywhere (with some escapes) than a mix (and people start using double quotes...)
- 'Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector'
# This one tends to do changes that we don't want (add new lines between variables which make no sense)
- 'Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector'
# This one is not stable yet (introduced in latest version)
- 'Rector\SOLID\Rector\ClassMethod\UseInterfaceOverImplementationInConstructorRector'
# This one seems buggy, see https://github.com/rectorphp/rector/issues/2187
- 'Rector\CodingStyle\Rector\ClassMethod\ReturnArrayClassMethodToYieldRector'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment