Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
composer require --dev assoconnect/php-quality-config
```

In rector, you can use the ruleset:

```php
return RectorConfig::configure()
->withSets([
__DIR__ . '/vendor/assoconnect/php-quality-config/src/Rector/rules.php',
])
```

## PHPStan

### Including in this package
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"phpstan/phpstan-strict-rules": "^1.1",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^9.6.16",
"rector/rector": "^1.2",
"roave/no-floaters": "^1.5",
"shipmonk/phpstan-rules": "^3.2",
"slevomat/coding-standard": "^8.6",
Expand Down
24 changes: 24 additions & 0 deletions src/Rector/rules.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

use Rector\CodeQuality\Rector\LogicalAnd\LogicalToBooleanRector;
use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector;
use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
use Rector\Config\RectorConfig;
use Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rules([
// Coding style
StaticArrowFunctionRector::class,
StaticClosureRector::class,
// Code Quality
LogicalToBooleanRector::class,
// Strict
BooleanInBooleanNotRuleFixerRector::class,
// Type Declaration
ReturnTypeFromStrictTypedCallRector::class,
]);
};
Loading