Skip to content

Commit e3d66f5

Browse files
committed
Use psaml class string type
1 parent f6b5ccd commit e3d66f5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/TypeResolver.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ final class TypeResolver
4242
/** @var int the iterator parser is inside a collection expression context */
4343
const PARSER_IN_COLLECTION_EXPRESSION = 3;
4444

45-
/** @var array<string, string> List of recognized keywords and unto which Value Object they map */
45+
/**
46+
* @var array<string, string> List of recognized keywords and unto which Value Object they map
47+
* @psalm-var array<string, class-string<Type>>
48+
*/
4649
private $keywords = [
4750
'string' => Types\String_::class,
4851
'int' => Types\Integer::class,
@@ -350,15 +353,10 @@ private function resolveTypedArray(string $type, Context $context): Array_
350353

351354
/**
352355
* Resolves the given keyword (such as `string`) into a Type object representing that keyword.
353-
* @psalm-suppress MoreSpecificReturnType
354356
*/
355357
private function resolveKeyword(string $type): Type
356358
{
357359
$className = $this->keywords[strtolower($type)];
358-
/**
359-
* @psalm-suppress LessSpecificReturnStatement
360-
* @psalm-suppress InvalidStringClass
361-
*/
362360
return new $className();
363361
}
364362

0 commit comments

Comments
 (0)