Skip to content

Commit

Permalink
TASK: Update rector
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbelasichon committed Nov 7, 2022
1 parent 0fddd80 commit 0791670
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"nette/utils": "^3.0",
"nikic/php-parser": "^4.14",
"phpstan/phpstan": "^1.7.12",
"rector/rector": "^0.14",
"rector/rector": "0.14.7",
"symfony/console": "^4.0 || ^5.0 || ^6.0",
"symfony/polyfill-php80": "^1.26",
"symfony/polyfill-php81": "^1.26",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ClassReflection;
use Rector\Core\Rector\AbstractScopeAwareRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

Expand Down Expand Up @@ -118,14 +117,7 @@ public function refactorWithScope(Node $node, Scope $scope): ?Node
$classHasChanged = true;
}

if ($classHasChanged) {
// invoke re-print
$node->setAttribute(AttributeKey::ORIGINAL_NODE, null);

return $node;
}

return null;
return $classHasChanged ? $node : null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class MySolrIndexer
*/
public function multiple(array $documents)
{
/** @var Apache_Solr_Document $document */
foreach ($documents as $document) {
$document->setMultiValue('key', 'foo', true);
}
Expand Down Expand Up @@ -52,6 +53,7 @@ class MySolrIndexer
*/
public function multiple(array $documents)
{
/** @var Apache_Solr_Document $document */
foreach ($documents as $document) {
$document->addField('key', 'foo', true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ use TYPO3\CMS\Core\Site\SiteLanguageAwareTrait;
class MyClass implements SiteLanguageAwareInterface
{
use SiteLanguageAwareTrait;

protected SiteLanguage $siteLanguage;

public function setSiteLanguage(SiteLanguage $siteLanguage)
{
$this->siteLanguage = $siteLanguage;
Expand Down

0 comments on commit 0791670

Please sign in to comment.