mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 03:40:50 +00:00
[CodingStyle] Skip non-empty-string on VarConstantCommentRector (#2451)
This commit is contained in:
parent
17b86d4b77
commit
ff931e4b74
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||
namespace Rector\StaticTypeMapper\Mapper;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PHPStan\Type\Accessory\AccessoryNonEmptyStringType;
|
||||
use PHPStan\Type\ArrayType;
|
||||
use PHPStan\Type\BooleanType;
|
||||
use PHPStan\Type\CallableType;
|
||||
|
@ -29,6 +30,7 @@ final class ScalarStringToTypeMapper
|
|||
*/
|
||||
private const SCALAR_NAME_BY_TYPE = [
|
||||
StringType::class => ['string'],
|
||||
AccessoryNonEmptyStringType::class => ['non-empty-string'],
|
||||
ClassStringType::class => ['class-string'],
|
||||
FloatType::class => ['float', 'real', 'double'],
|
||||
IntegerType::class => ['int', 'integer'],
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Tests\CodingStyle\Rector\ClassConst\VarConstantCommentRector\Fixture;
|
||||
|
||||
final class SkipNonEmptyStringVarDoc
|
||||
{
|
||||
/** @var non-empty-string */
|
||||
public const NAME = 'testing';
|
||||
|
||||
/**
|
||||
* @return non-empty-string
|
||||
*/
|
||||
public function run(): string
|
||||
{
|
||||
return self::NAME;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user