mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit 0c177409ed477e978433597639335fb2a78bc331
0c177409ed
Add support for getOneOrNullResult() method in ChildDoctrineRepositoryClassTypeRector (#5747)
This commit is contained in:
parent
817ab2f7cb
commit
00697fa4b6
|
@ -51,7 +51,7 @@ final class ChildDoctrineRepositoryClassTypeRector extends AbstractRector
|
|||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Add return type to classes that extend Doctrine\\ORM\\EntityRepository', [new CodeSample(<<<'CODE_SAMPLE'
|
||||
return new RuleDefinition('Add return type to classes that extend Doctrine\\ORM\\EntityRepository based on return Doctrine method names', [new CodeSample(<<<'CODE_SAMPLE'
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
/**
|
||||
|
@ -109,7 +109,9 @@ CODE_SAMPLE
|
|||
if ($this->shouldSkipClassMethod($classMethod)) {
|
||||
continue;
|
||||
}
|
||||
if ($this->containsMethodCallNamed($classMethod, 'findOneBy')) {
|
||||
if ($this->containsMethodCallNamed($classMethod, 'getOneOrNullResult')) {
|
||||
$classMethod->returnType = $this->createNullableType($entityClassName);
|
||||
} elseif ($this->containsMethodCallNamed($classMethod, 'findOneBy')) {
|
||||
$classMethod->returnType = $this->createNullableType($entityClassName);
|
||||
}
|
||||
if ($this->containsMethodCallNamed($classMethod, 'findBy')) {
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'f4070bb2b2f5c8f7a11063ce35549364c437a9cf';
|
||||
public const PACKAGE_VERSION = '0c177409ed477e978433597639335fb2a78bc331';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-03-21 10:52:56';
|
||||
public const RELEASE_DATE = '2024-03-21 11:01:32';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue