forked from zircote/swagger-php
-
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.
Add rector, upgrade codebase to using PHP 7.4 features
- Loading branch information
1 parent
a1a6ec1
commit 2f428a5
Showing
30 changed files
with
169 additions
and
258 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Rector\CodeQuality\Rector\ClassMethod\ExplicitReturnNullRector; | ||
use Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector; | ||
use Rector\CodeQuality\Rector\If_\CombineIfRector; | ||
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector; | ||
use Rector\CodeQuality\Rector\If_\ShortenElseIfRector; | ||
use Rector\Config\RectorConfig; | ||
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector; | ||
use Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector; | ||
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector; | ||
use Rector\ValueObject\PhpVersion; | ||
|
||
return RectorConfig::configure() | ||
->withRules([ | ||
TypedPropertyFromStrictConstructorRector::class | ||
]) | ||
->withSkip([ | ||
CombineIfRector::class, | ||
ExplicitBoolCompareRector::class, | ||
ExplicitReturnNullRector::class => [ | ||
__DIR__ . '/src/Analysers/TokenAnalyser.php', | ||
], | ||
ForRepeatedCountToOwnVariableRector::class, | ||
RemoveAlwaysTrueIfConditionRector::class => [ | ||
__DIR__ . '/src/Processors/ExpandEnums.php', | ||
] , | ||
RemoveDeadInstanceOfRector::class => [ | ||
__DIR__ . '/src/Processors/ExpandEnums.php', | ||
], | ||
ShortenElseIfRector::class, | ||
]) | ||
->withPreparedSets(true, true) | ||
->withPhpVersion(PhpVersion::PHP_74); |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* @license Apache 2.0 | ||
*/ | ||
|
||
namespace OpenApi\Analysers; | ||
|
||
use OpenApi\Generator; | ||
|
||
trait GeneratorAwareTrait | ||
{ | ||
protected ?Generator $generator = null; | ||
|
||
public function setGenerator(Generator $generator): void | ||
{ | ||
$this->generator = $generator; | ||
} | ||
} |
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
Oops, something went wrong.