Skip to content

Commit

Permalink
[TASK] Add rector
Browse files Browse the repository at this point in the history
  • Loading branch information
fseipel committed Jun 24, 2024
1 parent c146c7b commit 4b5c729
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
}
],
"require": {
"php": "^8.1",
"aws/aws-sdk-php": "^3.0",
"openai-php/client": "^0.6.0",
"typo3/cms-backend": "^11.5 || ^12.4",
Expand All @@ -39,10 +40,12 @@
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.11",
"rector/rector": "^1.1",
"saschaegerer/phpstan-typo3": "^1.10",
"sclable/xml-lint": "^0.7.0",
"slevomat/coding-standard": "^8.15",
"squizlabs/php_codesniffer": "^3.10"
"squizlabs/php_codesniffer": "^3.10",
"ssch/typo3-rector": "^2.6"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -80,15 +83,19 @@
],
"fix": [
"@composer normalize",
"@php:style:fix"
"@php:style:fix",
"@php:rector:fix"
],
"lint": [
"@composer:lint",
"@php:syntax:lint",
"@php:style:lint",
"@php:static:lint",
"@xml:lint"
"@xml:lint",
"@php:rector:lint"
],
"php:rector:fix": "rector",
"php:rector:lint": "rector --dry-run --no-progress-bar",
"php:static:lint": "phpstan analyse --ansi --no-progress --configuration=phpstan.neon",
"php:style:fix": "phpcbf",
"php:style:lint": "phpcs",
Expand Down
20 changes: 20 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Ssch\TYPO3Rector\Set\Typo3SetList;

return RectorConfig::configure()
->withPaths([
__DIR__ . '/Classes',
__DIR__ . '/Tests',
])
->withRootFiles()
->withImportNames(true, false, false, true)
->withPhpSets()
->withSets([
PHPUnitSetList::PHPUNIT_90,
Typo3SetList::TYPO3_11,
]);

0 comments on commit 4b5c729

Please sign in to comment.