extend tests

This commit is contained in:
Tomas Votruba 2018-12-08 00:35:22 +01:00
parent 04b2598aa5
commit fd9d66110f
2 changed files with 6 additions and 4 deletions

View File

@ -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);

View File

@ -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
{
}
}