Skip to content

Commit

Permalink
[StaticTypeMapper] Register non-empty-array to ScalarStringToTypeMapp…
Browse files Browse the repository at this point in the history
…er::SCALAR_NAME_BY_TYPE constant (#6374)
  • Loading branch information
samsonasik authored Oct 11, 2024
1 parent 28ba716 commit d553e84
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/StaticTypeMapper/Mapper/ScalarStringToTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use 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 @@ -32,6 +33,7 @@ final class ScalarStringToTypeMapper
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'],
Expand Down Expand Up @@ -76,10 +78,6 @@ public function mapScalarStringToType(string $scalarName): Type
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 d553e84

Please sign in to comment.