@@ -122,8 +122,6 @@ public function __construct(?FqsenResolver $fqsenResolver = null)
122122 * @uses Context::getNamespace() to determine with what to prefix the type name.
123123 *
124124 * @param string $type The relative or absolute type.
125- *
126- * @psalm-pure
127125 */
128126 public function resolve (string $ type , ?Context $ context = null ) : Type
129127 {
@@ -160,8 +158,6 @@ public function resolve(string $type, ?Context $context = null) : Type
160158 * @param ArrayIterator<int, string|null> $tokens the iterator on tokens
161159 * @param int $parserContext on of self::PARSER_* constants, indicating
162160 * the context where we are in the parsing
163- *
164- * @psalm-pure
165161 */
166162 private function parseTypes (ArrayIterator $ tokens , Context $ context , int $ parserContext ) : Type
167163 {
@@ -173,7 +169,9 @@ private function parseTypes(ArrayIterator $tokens, Context $context, int $parser
173169 throw new RuntimeException (
174170 'Unexpected nullable character '
175171 );
176- } elseif ($ token === '| ' ) {
172+ }
173+
174+ if ($ token === '| ' ) {
177175 if (count ($ types ) === 0 ) {
178176 throw new RuntimeException (
179177 'A type is missing before a type separator '
@@ -428,9 +426,7 @@ private function resolveTypedObject(string $type, ?Context $context = null) : Ob
428426 /**
429427 * Resolves class string
430428 *
431- * @param ArrayIterator<int, null|string> $tokens
432- *
433- * @psalm-pure
429+ * @param ArrayIterator<int, (string|null)> $tokens
434430 */
435431 private function resolveClassString (ArrayIterator $ tokens , Context $ context ) : Type
436432 {
@@ -463,11 +459,9 @@ private function resolveClassString(ArrayIterator $tokens, Context $context) : T
463459 /**
464460 * Resolves the collection values and keys
465461 *
466- * @param ArrayIterator<int, null| string> $tokens
462+ * @param ArrayIterator<int, ( string|null) > $tokens
467463 *
468464 * @return Array_|Iterable_|Collection
469- *
470- * @psalm-mutation-free
471465 */
472466 private function resolveCollection (ArrayIterator $ tokens , Type $ classType , Context $ context ) : Type
473467 {
0 commit comments