Skip to content

Commit

Permalink
Bump rector/rector from 0.18.3 to 0.18.4 (#128)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Markus Staab <[email protected]>
  • Loading branch information
dependabot[bot] and staabm authored Sep 29, 2023
1 parent 8934e1d commit d8df142
Show file tree
Hide file tree
Showing 288 changed files with 3,043 additions and 903 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"php": ">=7.4",
"rector/rector": "0.18.3",
"rector/rector": "0.18.4",
"friendsofphp/php-cs-fixer": "3.34.0",
"redaxo/php-cs-fixer-config": "^1.0"
},
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pages/target-chooser.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$batches = [];
if (
!is_dir($addonPath.'/.git') // the addon is versioned?
&& !is_dir(rex_path::base('.git')) // the while project is versioned?
&& !is_dir(rex_path::base('.git')) // the whole project is versioned?
) {
$batches[] = '<span class="label label-danger">unversioned sources</span>';
} elseif ($hasGit) {
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -552,17 +552,17 @@
},
{
"name": "rector/rector",
"version": "0.18.3",
"version_normalized": "0.18.3.0",
"version": "0.18.4",
"version_normalized": "0.18.4.0",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "ba7988e3e028e68e07191d75b0d5473ac320c5e7"
"reference": "d99a91176b7eb7f2b6d509a6486b3661c6dfd370"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/ba7988e3e028e68e07191d75b0d5473ac320c5e7",
"reference": "ba7988e3e028e68e07191d75b0d5473ac320c5e7",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/d99a91176b7eb7f2b6d509a6486b3661c6dfd370",
"reference": "d99a91176b7eb7f2b6d509a6486b3661c6dfd370",
"shasum": ""
},
"require": {
Expand All @@ -575,7 +575,7 @@
"rector/rector-phpunit": "*",
"rector/rector-symfony": "*"
},
"time": "2023-09-12T20:18:14+00:00",
"time": "2023-09-25T17:07:54+00:00",
"bin": [
"bin/rector"
],
Expand All @@ -599,7 +599,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/0.18.3"
"source": "https://github.com/rectorphp/rector/tree/0.18.4"
},
"funding": [
{
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '13ad0f8b7f6b5907a321acd981de10867a5aac02',
'reference' => '5993a6580305bb6a0105f81459edb77e2f9626a6',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '13ad0f8b7f6b5907a321acd981de10867a5aac02',
'reference' => '5993a6580305bb6a0105f81459edb77e2f9626a6',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -104,9 +104,9 @@
),
),
'rector/rector' => array(
'pretty_version' => '0.18.3',
'version' => '0.18.3.0',
'reference' => 'ba7988e3e028e68e07191d75b0d5473ac320c5e7',
'pretty_version' => '0.18.4',
'version' => '0.18.4.0',
'reference' => 'd99a91176b7eb7f2b6d509a6486b3661c6dfd370',
'type' => 'library',
'install_path' => __DIR__ . '/../rector/rector',
'aliases' => array(),
Expand Down
4 changes: 3 additions & 1 deletion vendor/rector/rector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ dump_node($node, 1);

## Known Drawbacks

Rector uses [nikic/php-parser](https://github.com/nikic/PHP-Parser/), built on technology called an *abstract syntax tree* (AST). An AST doesn't know about spaces and when written to a file it produces poorly formatted code in both PHP and docblock annotations.
* Rector uses [nikic/php-parser](https://github.com/nikic/PHP-Parser/), built on technology called an *abstract syntax tree* (AST). An AST doesn't know about spaces and when written to a file it produces poorly formatted code in both PHP and docblock annotations.

* Rector in parallel mode will work most of the times for most OS. On Windows, you may encounter issues unresolvable despite of following the [Troubleshooting Parallel](https://getrector.com/documentation/troubleshooting-parallel) guide. In such case, check if you are using Powershell 7 (pwsh). Change your terminal to command prompt (cmd) or bash for Windows.

### How to Apply Coding Standards?

Expand Down
4 changes: 1 addition & 3 deletions vendor/rector/rector/bin/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ public function loadIfExistsAndNotLoadedYet(string $filePath) : void
if (\in_array($filePath, $this->alreadyLoadedAutoloadFiles, \true)) {
return;
}
/** @var string $realPath always string after file_exists() check */
$realPath = \realpath($filePath);
if (!\is_string($realPath)) {
return;
}
$this->alreadyLoadedAutoloadFiles[] = $realPath;
require_once $filePath;
}
Expand Down
1 change: 1 addition & 0 deletions vendor/rector/rector/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$rectorConfig->autoloadPaths([]);
$rectorConfig->bootstrapFiles([]);
$rectorConfig->parallel();
$rectorConfig->disableCollectors();
// to avoid autoimporting out of the box
$rectorConfig->importNames(\false, \false);
$rectorConfig->removeUnusedImports(\false);
Expand Down
3 changes: 1 addition & 2 deletions vendor/rector/rector/config/set/coding-style.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector;
use Rector\CodingStyle\Rector\String_\UseClassKeywordForClassNameResolutionRector;
use Rector\CodingStyle\Rector\Switch_\BinarySwitchToIfElseRector;
use Rector\CodingStyle\Rector\Ternary\TernaryConditionVariableAssignmentRector;
use Rector\CodingStyle\Rector\Use_\SeparateMultiUseImportsRector;
use Rector\Config\RectorConfig;
Expand All @@ -37,5 +36,5 @@
use Rector\Visibility\Rector\ClassMethod\ExplicitPublicClassMethodRector;
return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->ruleWithConfiguration(FuncCallToConstFetchRector::class, ['php_sapi_name' => 'PHP_SAPI', 'pi' => 'M_PI']);
$rectorConfig->rules([SeparateMultiUseImportsRector::class, PostIncDecToPreIncDecRector::class, NewlineAfterStatementRector::class, RemoveFinalFromConstRector::class, NullableCompareToNullRector::class, BinarySwitchToIfElseRector::class, ConsistentImplodeRector::class, TernaryConditionVariableAssignmentRector::class, SymplifyQuoteEscapeRector::class, StringClassNameToClassConstantRector::class, CatchExceptionNameMatchingTypeRector::class, UseIncrementAssignRector::class, SplitDoubleAssignRector::class, EncapsedStringsToSprintfRector::class, WrapEncapsedVariableInCurlyBracesRector::class, NewlineBeforeNewAssignSetRector::class, AddArrayDefaultToArrayPropertyRector::class, MakeInheritedMethodVisibilitySameAsParentRector::class, CallUserFuncArrayToVariadicRector::class, VersionCompareFuncCallToConstantRector::class, StaticArrowFunctionRector::class, StaticClosureRector::class, CountArrayToEmptyArrayComparisonRector::class, CallUserFuncToMethodCallRector::class, FuncGetArgsToVariadicParamRector::class, StrictArraySearchRector::class, UseClassKeywordForClassNameResolutionRector::class, SplitGroupedPropertiesRector::class, SplitGroupedClassConstantsRector::class, ExplicitPublicClassMethodRector::class]);
$rectorConfig->rules([SeparateMultiUseImportsRector::class, PostIncDecToPreIncDecRector::class, NewlineAfterStatementRector::class, RemoveFinalFromConstRector::class, NullableCompareToNullRector::class, ConsistentImplodeRector::class, TernaryConditionVariableAssignmentRector::class, SymplifyQuoteEscapeRector::class, StringClassNameToClassConstantRector::class, CatchExceptionNameMatchingTypeRector::class, UseIncrementAssignRector::class, SplitDoubleAssignRector::class, EncapsedStringsToSprintfRector::class, WrapEncapsedVariableInCurlyBracesRector::class, NewlineBeforeNewAssignSetRector::class, AddArrayDefaultToArrayPropertyRector::class, MakeInheritedMethodVisibilitySameAsParentRector::class, CallUserFuncArrayToVariadicRector::class, VersionCompareFuncCallToConstantRector::class, StaticArrowFunctionRector::class, StaticClosureRector::class, CountArrayToEmptyArrayComparisonRector::class, CallUserFuncToMethodCallRector::class, FuncGetArgsToVariadicParamRector::class, StrictArraySearchRector::class, UseClassKeywordForClassNameResolutionRector::class, SplitGroupedPropertiesRector::class, SplitGroupedClassConstantsRector::class, ExplicitPublicClassMethodRector::class]);
};
3 changes: 1 addition & 2 deletions vendor/rector/rector/config/set/type-declaration.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@
use Rector\TypeDeclaration\Rector\FunctionLike\AddReturnTypeDeclarationFromYieldsRector;
use Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorReadonlyClassRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector;
return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->rules([AddArrowFunctionReturnTypeRector::class, ParamTypeByMethodCallTypeRector::class, TypedPropertyFromAssignsRector::class, AddReturnTypeDeclarationBasedOnParentClassMethodRector::class, ReturnTypeFromStrictTypedPropertyRector::class, TypedPropertyFromStrictConstructorRector::class, TypedPropertyFromStrictConstructorReadonlyClassRector::class, ParamTypeFromStrictTypedPropertyRector::class, AddVoidReturnTypeWhereNoReturnRector::class, ReturnTypeFromStrictFluentReturnRector::class, ReturnTypeFromReturnNewRector::class, TypedPropertyFromStrictGetterMethodReturnTypeRector::class, AddMethodCallBasedStrictParamTypeRector::class, ReturnTypeFromStrictBoolReturnExprRector::class, ReturnTypeFromStrictNativeCallRector::class, ReturnTypeFromStrictNewArrayRector::class, ReturnTypeFromStrictScalarReturnExprRector::class, ReturnTypeFromStrictParamRector::class, TypedPropertyFromStrictSetUpRector::class, ParamTypeByParentCallTypeRector::class, AddParamTypeSplFixedArrayRector::class, AddParamTypeBasedOnPHPUnitDataProviderRector::class, AddParamTypeFromPropertyTypeRector::class, AddReturnTypeDeclarationFromYieldsRector::class, ReturnTypeFromReturnDirectArrayRector::class, ReturnTypeFromStrictConstantReturnRector::class, ReturnTypeFromStrictTypedCallRector::class, ReturnNeverTypeRector::class, EmptyOnNullableObjectToInstanceOfRector::class, PropertyTypeFromStrictSetterGetterRector::class, ReturnTypeFromStrictTernaryRector::class, BoolReturnTypeFromStrictScalarReturnsRector::class, NumericReturnTypeFromStrictScalarReturnsRector::class, StrictArrayParamDimFetchRector::class, ReturnUnionTypeRector::class, StrictStringParamConcatRector::class]);
$rectorConfig->rules([AddArrowFunctionReturnTypeRector::class, ParamTypeByMethodCallTypeRector::class, TypedPropertyFromAssignsRector::class, AddReturnTypeDeclarationBasedOnParentClassMethodRector::class, ReturnTypeFromStrictTypedPropertyRector::class, TypedPropertyFromStrictConstructorRector::class, ParamTypeFromStrictTypedPropertyRector::class, AddVoidReturnTypeWhereNoReturnRector::class, ReturnTypeFromStrictFluentReturnRector::class, ReturnTypeFromReturnNewRector::class, TypedPropertyFromStrictGetterMethodReturnTypeRector::class, AddMethodCallBasedStrictParamTypeRector::class, ReturnTypeFromStrictBoolReturnExprRector::class, ReturnTypeFromStrictNativeCallRector::class, ReturnTypeFromStrictNewArrayRector::class, ReturnTypeFromStrictScalarReturnExprRector::class, ReturnTypeFromStrictParamRector::class, TypedPropertyFromStrictSetUpRector::class, ParamTypeByParentCallTypeRector::class, AddParamTypeSplFixedArrayRector::class, AddParamTypeBasedOnPHPUnitDataProviderRector::class, AddParamTypeFromPropertyTypeRector::class, AddReturnTypeDeclarationFromYieldsRector::class, ReturnTypeFromReturnDirectArrayRector::class, ReturnTypeFromStrictConstantReturnRector::class, ReturnTypeFromStrictTypedCallRector::class, ReturnNeverTypeRector::class, EmptyOnNullableObjectToInstanceOfRector::class, PropertyTypeFromStrictSetterGetterRector::class, ReturnTypeFromStrictTernaryRector::class, BoolReturnTypeFromStrictScalarReturnsRector::class, NumericReturnTypeFromStrictScalarReturnsRector::class, StrictArrayParamDimFetchRector::class, ReturnUnionTypeRector::class, StrictStringParamConcatRector::class]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ public function getTemplateTagValueNodes() : array
}
/**
* @deprecated Change doc block and print directly in the node instead
* @internal
* Should be handled by attributes of phpdoc node - if stard_and_end is missing in one of nodes, it has been changed
*
* @api
Expand Down Expand Up @@ -372,7 +371,9 @@ public function getGenericTagClassNames() : array
$genericTagValueNodes = $this->phpDocNodeByTypeFinder->findByType($this->phpDocNode, GenericTagValueNode::class);
$resolvedClasses = [];
foreach ($genericTagValueNodes as $genericTagValueNode) {
$resolvedClasses[] = $genericTagValueNode->value;
if ($genericTagValueNode->value !== '') {
$resolvedClasses[] = $genericTagValueNode->value;
}
}
return $resolvedClasses;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Rector\BetterPhpDocParser\ValueObject\Parser\BetterTokenIterator;
use Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey;
use Rector\BetterPhpDocParser\ValueObject\StartAndEnd;
use Rector\Core\Configuration\CurrentNodeProvider;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\StaticTypeMapper\StaticTypeMapper;
final class PhpDocInfoFactory
Expand All @@ -24,11 +23,6 @@ final class PhpDocInfoFactory
* @var \Rector\BetterPhpDocParser\PhpDocNodeMapper
*/
private $phpDocNodeMapper;
/**
* @readonly
* @var \Rector\Core\Configuration\CurrentNodeProvider
*/
private $currentNodeProvider;
/**
* @readonly
* @var \PHPStan\PhpDocParser\Lexer\Lexer
Expand Down Expand Up @@ -58,10 +52,9 @@ final class PhpDocInfoFactory
* @var array<int, PhpDocInfo>
*/
private $phpDocInfosByObjectId = [];
public function __construct(PhpDocNodeMapper $phpDocNodeMapper, CurrentNodeProvider $currentNodeProvider, Lexer $lexer, BetterPhpDocParser $betterPhpDocParser, StaticTypeMapper $staticTypeMapper, AnnotationNaming $annotationNaming, PhpDocNodeByTypeFinder $phpDocNodeByTypeFinder)
public function __construct(PhpDocNodeMapper $phpDocNodeMapper, Lexer $lexer, BetterPhpDocParser $betterPhpDocParser, StaticTypeMapper $staticTypeMapper, AnnotationNaming $annotationNaming, PhpDocNodeByTypeFinder $phpDocNodeByTypeFinder)
{
$this->phpDocNodeMapper = $phpDocNodeMapper;
$this->currentNodeProvider = $currentNodeProvider;
$this->lexer = $lexer;
$this->betterPhpDocParser = $betterPhpDocParser;
$this->staticTypeMapper = $staticTypeMapper;
Expand All @@ -87,8 +80,6 @@ public function createFromNode(Node $node) : ?\Rector\BetterPhpDocParser\PhpDocI
if (isset($this->phpDocInfosByObjectId[$objectId])) {
return $this->phpDocInfosByObjectId[$objectId];
}
/** @see \Rector\BetterPhpDocParser\PhpDocParser\DoctrineAnnotationDecorator::decorate() */
$this->currentNodeProvider->setNode($node);
$docComment = $node->getDocComment();
if (!$docComment instanceof Doc) {
if ($node->getComments() === []) {
Expand All @@ -112,8 +103,6 @@ public function createFromNode(Node $node) : ?\Rector\BetterPhpDocParser\PhpDocI
*/
public function createEmpty(Node $node) : \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo
{
/** @see \Rector\BetterPhpDocParser\PhpDocParser\DoctrineAnnotationDecorator::decorate() */
$this->currentNodeProvider->setNode($node);
$phpDocNode = new PhpDocNode([]);
$phpDocInfo = $this->createFromPhpDocNode($phpDocNode, new BetterTokenIterator([]), $node);
// multiline by default
Expand Down
Loading

0 comments on commit d8df142

Please sign in to comment.