mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 11:44:14 +01:00
commit
ac093877b8
4
.github/workflows/test_with_doctrine.yaml
vendored
4
.github/workflows/test_with_doctrine.yaml
vendored
@ -33,6 +33,4 @@ jobs:
|
||||
composer install -d orm --no-dev
|
||||
|
||||
- run: |
|
||||
# bin/rector process orm/lib --config ci/config/rector-doctrine.yaml --autoload-file orm/vendor/autoload.php
|
||||
bin/rector process orm/lib/Doctrine/ORM/Persisters/Entity/SingleTablePersister.php --config ci/config/rector-doctrine.yaml --autoload-file orm/vendor/autoload.php --debug
|
||||
bin/rector process orm/lib/Doctrine/ORM/Tools/SchemaTool.php --config ci/config/rector-doctrine.yaml --autoload-file orm/vendor/autoload.php --debug
|
||||
bin/rector process orm/lib --config ci/config/rector-doctrine.yaml --autoload-file orm/vendor/autoload.php
|
||||
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Rector\DeadCode\Rector\ClassMethod;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Expr\StaticCall;
|
||||
@ -14,6 +13,7 @@ use PhpParser\Node\Stmt\ClassLike;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\Core\PhpParser\Node\Value\ValueResolver;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
@ -176,13 +176,13 @@ PHP
|
||||
|
||||
private function hasRequiredAnnotation(Node $node): bool
|
||||
{
|
||||
if ($node->getDocComment() === null) {
|
||||
/** @var PhpDocInfo|null $phpDocInfo */
|
||||
$phpDocInfo = $node->getAttribute(AttributeKey::PHP_DOC_INFO);
|
||||
if ($phpDocInfo === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$docCommentText = $node->getDocComment()->getText();
|
||||
|
||||
return (bool) Strings::match($docCommentText, '#\s\@required\s#si');
|
||||
return (bool) $phpDocInfo->hasByName('required');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -201,7 +201,8 @@ PHP
|
||||
}
|
||||
|
||||
$param = $params[$key];
|
||||
if (! $this->areNamesEqual($param->var, $arg->value)) {
|
||||
|
||||
if (! $this->areNodesWithoutCommentsEqual($param->var, $arg->value)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ PHP
|
||||
return null;
|
||||
}
|
||||
|
||||
if (! $this->areNamesEqual($onlyCatch->var, $onlyCatchStmt->expr)) {
|
||||
if (! $this->areNodesWithoutCommentsEqual($onlyCatch->var, $onlyCatchStmt->expr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user