mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 11:44:14 +01:00
extend tests
This commit is contained in:
parent
04b2598aa5
commit
fd9d66110f
@ -196,7 +196,6 @@ abstract class AbstractScalarTypehintRector extends AbstractRector
|
||||
return null;
|
||||
}
|
||||
|
||||
// @todo add test for ?self
|
||||
if ($nakedType->toString() === 'self') {
|
||||
$className = $node->getAttribute(Attribute::CLASS_NAME);
|
||||
$type = new FullyQualified($className);
|
||||
@ -204,7 +203,6 @@ abstract class AbstractScalarTypehintRector extends AbstractRector
|
||||
return $returnTypeInfo->isNullable() ? new NullableType($type) : $type;
|
||||
}
|
||||
|
||||
// @todo add test for ?parent
|
||||
if ($nakedType->toString() === 'parent') {
|
||||
$parentClassName = $node->getAttribute(Attribute::PARENT_CLASS_NAME);
|
||||
$type = new FullyQualified($parentClassName);
|
||||
|
@ -5,9 +5,11 @@ namespace Rector\Php\Tests\Rector\ClassMethod\ParamAndReturnScalarTypehintsRecto
|
||||
class ThisClass
|
||||
{
|
||||
/**
|
||||
* @param $this $param
|
||||
* @param null|$this $param2
|
||||
* @return $this
|
||||
*/
|
||||
function someFunction()
|
||||
function someFunction($param, $param2)
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -21,9 +23,11 @@ namespace Rector\Php\Tests\Rector\ClassMethod\ParamAndReturnScalarTypehintsRecto
|
||||
class ThisClass
|
||||
{
|
||||
/**
|
||||
* @param $this $param
|
||||
* @param null|$this $param2
|
||||
* @return $this
|
||||
*/
|
||||
function someFunction(): self
|
||||
function someFunction(self $param, ?self $param2): self
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user