Skip to content

Commit

Permalink
Updated Rector to commit 39cce5ccb84ce4ac40eeae113db339a961db9489
Browse files Browse the repository at this point in the history
rectorphp/rector-src@39cce5c [ECS] Skip SelfAccessorFixer on *Rector.php to skip example code for using using self:: (#5363)
  • Loading branch information
TomasVotruba committed Dec 16, 2023
1 parent 7bf2453 commit bd56d13
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function run()
}
}
CODE_SAMPLE
, [self::LIMIT_VALUE => 1000000])]);
, [\Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::LIMIT_VALUE => 1000000])]);
}
/**
* @return array<class-string<Node>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function __construct(
}
}
CODE_SAMPLE
, [self::INLINE_PUBLIC => \false])]);
, [\Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector::INLINE_PUBLIC => \false])]);
}
public function configure(array $configuration) : void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function run(#[\SensitiveParameter] string $password)
}
}
CODE_SAMPLE
, [self::SENSITIVE_PARAMETERS => ['password']])]);
, [\Rector\Php82\Rector\Param\AddSensitiveParameterAttributeRector::SENSITIVE_PARAMETERS => ['password']])]);
}
public function provideMinPhpVersion() : int
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function run(string|null $name)
}
}
CODE_SAMPLE
, [self::TREAT_AS_NON_EMPTY => \true])]);
, [\Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector::TREAT_AS_NON_EMPTY => \true])]);
}
/**
* @return array<class-string<Node>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function run(array $items)
}
}
CODE_SAMPLE
, [self::TREAT_AS_NON_EMPTY => \false])]);
, [\Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector::TREAT_AS_NON_EMPTY => \false])]);
}
/**
* @return array<class-string<Node>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function run(string $name)
}
}
CODE_SAMPLE
, [self::TREAT_AS_NON_EMPTY => \false])]);
, [\Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector::TREAT_AS_NON_EMPTY => \false])]);
}
/**
* @return array<class-string<Node>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function run(array $data)
}
}
CODE_SAMPLE
, [self::TREAT_AS_NON_EMPTY => \false])]);
, [\Rector\Strict\Rector\Ternary\BooleanInTernaryOperatorRuleFixerRector::TREAT_AS_NON_EMPTY => \false])]);
}
/**
* @return array<class-string<Node>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function run(array $array)
}
}
CODE_SAMPLE
, [self::TREAT_AS_NON_EMPTY => \false])]);
, [\Rector\Strict\Rector\Ternary\DisallowedShortTernaryRuleFixerRector::TREAT_AS_NON_EMPTY => \false])]);
}
/**
* @return array<class-string<Node>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
declare (strict_types=1);
namespace Rector\Transform\Rector\Attribute;

use PhpParser\Node\Arg;
use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node;
use PhpParser\Node\AttributeGroup;
use PhpParser\Node\Expr\ArrowFunction;
Expand Down Expand Up @@ -123,15 +125,15 @@ private function processToClassConstFetch(AttributeGroup $attributeGroup, Attrib
}
return $hasChanged;
}
private function processArg(Node\Arg $arg, AttributeKeyToClassConstFetch $attributeKeyToClassConstFetch) : bool
private function processArg(Arg $arg, AttributeKeyToClassConstFetch $attributeKeyToClassConstFetch) : bool
{
$value = $this->valueResolver->getValue($arg->value);
$constName = $attributeKeyToClassConstFetch->getValuesToConstantsMap()[$value] ?? null;
if ($constName === null) {
return \false;
}
$newValue = $this->nodeFactory->createClassConstFetch($attributeKeyToClassConstFetch->getConstantClass(), $constName);
if ($arg->value instanceof Node\Expr\ClassConstFetch && $this->getName($arg->value) === $this->getName($newValue)) {
if ($arg->value instanceof ClassConstFetch && $this->getName($arg->value) === $this->getName($newValue)) {
return \false;
}
$arg->value = $newValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function run()
}
}
CODE_SAMPLE
, [self::INLINE_PUBLIC => \false])]);
, [\Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector::INLINE_PUBLIC => \false])]);
}
/**
* @return array<class-string<Node>>
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '227e97477c44de40c165bba4b72e48dd954151d5';
public const PACKAGE_VERSION = '39cce5ccb84ce4ac40eeae113db339a961db9489';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-12-16 09:53:16';
public const RELEASE_DATE = '2023-12-16 16:40:38';
/**
* @var int
*/
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -858,17 +858,17 @@
},
{
"name": "phpstan\/phpdoc-parser",
"version": "1.24.4",
"version_normalized": "1.24.4.0",
"version": "1.24.5",
"version_normalized": "1.24.5.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpdoc-parser.git",
"reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496"
"reference": "fedf211ff14ec8381c9bf5714e33a7a552dd1acc"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/6bd0c26f3786cd9b7c359675cb789e35a8e07496",
"reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/fedf211ff14ec8381c9bf5714e33a7a552dd1acc",
"reference": "fedf211ff14ec8381c9bf5714e33a7a552dd1acc",
"shasum": ""
},
"require": {
Expand All @@ -885,7 +885,7 @@
"phpunit\/phpunit": "^9.5",
"symfony\/process": "^5.2"
},
"time": "2023-11-26T18:29:22+00:00",
"time": "2023-12-16T09:33:33+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand All @@ -902,7 +902,7 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https:\/\/github.com\/phpstan\/phpdoc-parser\/issues",
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.24.4"
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.24.5"
},
"install-path": "..\/phpstan\/phpdoc-parser"
},
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/installed.php

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions vendor/phpstan/phpdoc-parser/src/Printer/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ private function printNodeFormatPreserving(Node $node, TokenIterator $originalTo
if ($subStartPos < 0 || $subEndPos < 0) {
throw new LogicException();
}
if ($subEndPos < $subStartPos) {
return $this->print($node);
}
if ($subNode === null) {
return $this->print($node);
}
Expand Down

0 comments on commit bd56d13

Please sign in to comment.