-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* helpful rector, declare return values * adds php 8.2 to testing matrix * adds symfony/phpunit-bridge * make circleci config consistent with other getdkan packages
- Loading branch information
Showing
9 changed files
with
77 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,50 @@ | ||
<?php | ||
|
||
/** | ||
* Generic PHP 7.4 update. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\Set\ValueObject\LevelSetList; | ||
use Rector\Core\ValueObject\PhpVersion; | ||
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector; | ||
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; | ||
use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector; | ||
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; | ||
use Rector\Set\ValueObject\SetList; | ||
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->paths([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/test', | ||
]); | ||
|
||
// Our base version of PHP. | ||
$rectorConfig->phpVersion(PhpVersion::PHP_74); | ||
|
||
$rectorConfig->sets([ | ||
LevelSetList::UP_TO_PHP_74, | ||
SetList::PHP_82, | ||
// Please no dead code or unneeded variables. | ||
SetList::DEAD_CODE, | ||
// Try to figure out type hints. | ||
SetList::TYPE_DECLARATION, | ||
]); | ||
|
||
$rectorConfig->skip([ | ||
// Don't throw errors on JSON parse problems. Yet. | ||
// @todo Throw errors and deal with them appropriately. | ||
JsonThrowOnErrorRector::class, | ||
// We like our tags. Please don't remove them. | ||
RemoveUselessParamTagRector::class, | ||
RemoveUselessReturnTagRector::class, | ||
RemoveUselessVarTagRector::class, | ||
ArrayShapeFromConstantArrayReturnRector::class, | ||
AddMethodCallBasedStrictParamTypeRector::class, | ||
AddArrowFunctionReturnTypeRector::class, | ||
ReturnTypeFromStrictTypedCallRector::class, | ||
]); | ||
|
||
$rectorConfig->importNames(); | ||
$rectorConfig->importShortClasses(false); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters