mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 04:19:44 +01:00
remove preslash custom type
This commit is contained in:
parent
94160332e1
commit
ff8d50e93a
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\BetterPhpDocParser\Type;
|
||||
|
||||
use PHPStan\Type\StringType;
|
||||
use PHPStan\Type\VerbosityLevel;
|
||||
|
||||
final class PreSlashStringType extends StringType
|
||||
{
|
||||
public function describe(VerbosityLevel $verbosityLevel): string
|
||||
{
|
||||
return '\string';
|
||||
}
|
||||
}
|
@ -80,7 +80,7 @@ final class ParamTypeResolver implements NodeTypeResolverInterface
|
||||
return $this->resolveFromFunctionDocBlock($node);
|
||||
}
|
||||
|
||||
private function resolveFromType(Node $node)
|
||||
private function resolveFromType(Node $node): Type
|
||||
{
|
||||
if ($node->type !== null && ! $node->type instanceof Identifier) {
|
||||
$resolveTypeName = $this->nodeNameResolver->getName($node->type);
|
||||
|
@ -41,7 +41,6 @@ final class ArrayTypeMapper implements PhpDocTypeMapperInterface
|
||||
{
|
||||
$nestedType = $this->phpDocTypeMapper->mapToPHPStanType($typeNode->type, $node, $nameScope);
|
||||
|
||||
// @todo improve for key!
|
||||
return new ArrayType(new MixedType(), $nestedType);
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ use PHPStan\Type\StaticType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\AttributeAwarePhpDoc\Ast\Type\AttributeAwareIdentifierTypeNode;
|
||||
use Rector\BetterPhpDocParser\Type\PreSlashStringType;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\PHPStan\Type\ParentStaticType;
|
||||
use Rector\PHPStan\Type\SelfObjectType;
|
||||
@ -60,11 +61,6 @@ final class IdentifierTypeMapper implements PhpDocTypeMapperInterface
|
||||
|
||||
$loweredName = strtolower($typeNode->name);
|
||||
|
||||
// @todo for all scalars
|
||||
if ($loweredName === '\string') {
|
||||
return new PreSlashStringType();
|
||||
}
|
||||
|
||||
if ($loweredName === 'class-string') {
|
||||
return new ClassStringType();
|
||||
}
|
||||
|
@ -6,6 +6,6 @@ namespace Rector\PHPStanExtensions\Tests\Rule\SeeAnnotationToTestRule;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class CorrectSeeRectorTest extends TestCase
|
||||
final class CorrectSeeRector extends TestCase
|
||||
{
|
||||
}
|
@ -10,7 +10,7 @@ use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\PHPStanExtensions\Tests\Rule\SeeAnnotationToTestRule\CorrectSeeRectorTest
|
||||
* @see \Rector\PHPStanExtensions\Tests\Rule\SeeAnnotationToTestRule\CorrectSeeRector
|
||||
*/
|
||||
final class CorrectSeeRector extends AbstractRector implements PhpRectorInterface
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user