refactor(phpcs): update ruleset name and remove unused rules
refactor(pint): change preset to psr12 and add version refactor(rector): simplify configuration and remove Laravel-specific sets
This commit is contained in:
parent
d508a0cb86
commit
e8280b1f1d
3 changed files with 14 additions and 35 deletions
15
phpcs.xml
15
phpcs.xml
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ruleset name="Php Coding Standard"
|
||||
<ruleset name="UWIL 1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
|
||||
|
||||
<description>Standard optimisé : Analyse statique complémentaire à Pint.</description>
|
||||
<description>Standard optimisé: Analyse statique complémentaire à Pint.</description>
|
||||
|
||||
<arg name="colors" />
|
||||
<arg name="extensions" value="php" />
|
||||
|
|
@ -49,17 +49,6 @@
|
|||
</properties>
|
||||
</rule>
|
||||
|
||||
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses" />
|
||||
|
||||
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
|
||||
<properties>
|
||||
<property name="spacesCountAroundEqualsSign" value="0" />
|
||||
<property name="declareOnFirstLine" value="false" />
|
||||
<property name="linesCountBeforeDeclare" value="1" />
|
||||
<property name="linesCountAfterDeclare" value="1" />
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
|
||||
<exclude-pattern>*/database/migrations/*</exclude-pattern>
|
||||
</rule>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"preset": "laravel",
|
||||
"preset": "psr12",
|
||||
"version": "1.0.0",
|
||||
"rules": {
|
||||
"indentation_type": true,
|
||||
"single_line_empty_body": false,
|
||||
|
|
|
|||
31
rector.php
31
rector.php
|
|
@ -3,32 +3,21 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use RectorLaravel\Set\LaravelLevelSetList;
|
||||
use RectorLaravel\Set\LaravelSetList;
|
||||
use RectorLaravel\Set\LaravelSetProvider;
|
||||
use Rector\Set\ValueObject\SetList;
|
||||
|
||||
return RectorConfig::configure()
|
||||
->withSetProviders(LaravelSetProvider::class)
|
||||
->withPaths([
|
||||
__DIR__ . '/src',
|
||||
__DIR__ . '/bootstrap',
|
||||
__DIR__ . '/config',
|
||||
__DIR__ . '/public',
|
||||
__DIR__ . '/resources',
|
||||
__DIR__ . '/routes',
|
||||
__DIR__ . '/tests',
|
||||
])
|
||||
->withPhpSets()
|
||||
->withComposerBased(laravel: true)
|
||||
->withSets([
|
||||
LaravelLevelSetList::UP_TO_LARAVEL_130,
|
||||
LaravelSetList::LARAVEL_CODE_QUALITY,
|
||||
LaravelSetList::LARAVEL_COLLECTION,
|
||||
LaravelSetList::LARAVEL_IF_HELPERS,
|
||||
LaravelSetList::LARAVEL_LEGACY_FACTORIES_TO_CLASSES,
|
||||
LaravelSetList::LARAVEL_TYPE_DECLARATIONS,
|
||||
LaravelSetList::LARAVEL_ELOQUENT_MAGIC_METHOD_TO_QUERY_BUILDER,
|
||||
])
|
||||
->withTypeCoverageLevel(0)
|
||||
->withDeadCodeLevel(0)
|
||||
->withCodeQualityLevel(0);
|
||||
SetList::PHP_POLYFILLS,
|
||||
SetList::CODE_QUALITY,
|
||||
SetList::DEAD_CODE,
|
||||
SetList::PRIVATIZATION,
|
||||
SetList::TYPE_DECLARATION,
|
||||
SetList::EARLY_RETURN,
|
||||
SetList::INSTANCEOF,
|
||||
SetList::IF,
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue