Skip to content

Commit

Permalink
Updated Rector to commit d553e84b406dbea66f4ca1dcca58f6405147c2c5
Browse files Browse the repository at this point in the history
rectorphp/rector-src@d553e84 [StaticTypeMapper] Register non-empty-array to ScalarStringToTypeMapper::SCALAR_NAME_BY_TYPE constant (#6374)
  • Loading branch information
TomasVotruba committed Oct 11, 2024
1 parent c522933 commit 4dd8bdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '28ba716ca753c2a2a1a0d22ef7aec12af2d81ba0';
public const PACKAGE_VERSION = 'd553e84b406dbea66f4ca1dcca58f6405147c2c5';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-10-11 10:42:38';
public const RELEASE_DATE = '2024-10-11 15:45:42';
/**
* @var int
*/
Expand Down
6 changes: 2 additions & 4 deletions src/StaticTypeMapper/Mapper/ScalarStringToTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use RectorPrefix202410\Nette\Utils\Strings;
use PHPStan\Type\Accessory\AccessoryNonEmptyStringType;
use PHPStan\Type\Accessory\NonEmptyArrayType;
use PHPStan\Type\ArrayType;
use PHPStan\Type\BooleanType;
use PHPStan\Type\CallableType;
Expand All @@ -27,7 +28,7 @@ final class ScalarStringToTypeMapper
/**
* @var array<class-string<Type>, string[]>
*/
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'], BooleanType::class => ['bool', 'boolean'], NullType::class => ['null'], VoidType::class => ['void'], ResourceType::class => ['resource'], CallableType::class => ['callback', 'callable'], ObjectWithoutClassType::class => ['object'], NeverType::class => ['never', 'never-return', 'never-returns', 'no-return']];
private const SCALAR_NAME_BY_TYPE = [StringType::class => ['string'], AccessoryNonEmptyStringType::class => ['non-empty-string'], NonEmptyArrayType::class => ['non-empty-array'], ClassStringType::class => ['class-string'], FloatType::class => ['float', 'real', 'double'], IntegerType::class => ['int', 'integer'], BooleanType::class => ['bool', 'boolean'], NullType::class => ['null'], VoidType::class => ['void'], ResourceType::class => ['resource'], CallableType::class => ['callback', 'callable'], ObjectWithoutClassType::class => ['object'], NeverType::class => ['never', 'never-return', 'never-returns', 'no-return']];
public function mapScalarStringToType(string $scalarName) : Type
{
$loweredScalarName = Strings::lower($scalarName);
Expand All @@ -52,9 +53,6 @@ public function mapScalarStringToType(string $scalarName) : Type
if ($loweredScalarName === 'array') {
return new ArrayType(new MixedType(), new MixedType());
}
if ($loweredScalarName === 'non-empty-array') {
return new ArrayType(new MixedType(), new MixedType());
}
if ($loweredScalarName === 'iterable') {
return new IterableType(new MixedType(), new MixedType());
}
Expand Down

0 comments on commit 4dd8bdd

Please sign in to comment.