Repository: symfony/symfony
File: src/Symfony/Component/TypeInfo/Tests/TypeResolver/StringTypeResolverTest.php (PHP)

Code before:

        // object shape
        yield [Type::object(), 'object{foo: true, bar: false}'];

        // this
        yield [Type::object(Dummy::class), '$this', $typeContextFactory->createFromClassName(Dummy::class, AbstractDummy::class)];

        // const
        yield [Type::array(), 'array[1, 2, 3]'];
        yield [Type::false(), 'false'];
        yield [Type::float(), '1.23'];
        yield [Type::int(), '1'];
        yield [Type::null(), 'null'];
        yield [Type::string(), '"string"'];
        yield [Type::true(), 'true'];

        // const fetch
        yield [Type::string(), DummyWithConstants::class.'::DUMMY_STRING_*'];
        yield [Type::string(), DummyWithConstants::class.'::DUMMY_STRING_A'];
        yield [Type::int(), DummyWithConstants::class.'::DUMMY_INT_*'];
        yield [Type::int(), DummyWithConstants::class.'::DUMMY_INT_A'];
        yield [Type::float(), DummyWithConstants::class.'::DUMMY_FLOAT_*'];
        yield [Type::bool(), DummyWithConstants::class.'::DUMMY_TRUE_*'];
        yield [Type::bool(), DummyWithConstants::class.'::DUMMY_FALSE_*'];
        yield [Type::null(), DummyWithConstants::class.'::DUMMY_NULL_*'];
        yield [Type::array(), DummyWithConstants::class.'::DUMMY_ARRAY_*'];
        yield [Type::enum(DummyEnum::class, Type::string()), DummyWithConstants::class.'::DUMMY_ENUM_*'];
        yield [Type::union(Type::string(), Type::int(), Type::float(), Type::bool(), Type::null(), Type::array(), Type::enum(DummyEnum::class, Type::string())), DummyWithConstants::class.'::DUMMY_MIX_*'];

        // identifiers
        yield [Type::bool(), 'bool'];
        yield [Type::bool(), 'boolean'];
        yield [Type::true(), 'true'];
        yield [Type::false(), 'false'];
        yield [Type::int(), 'int'];
        yield [Type::int(), 'integer'];
        yield [Type::int(), 'positive-int'];
        yield [Type::int(), 'negative-int'];
        yield [Type::int(), 'non-positive-int'];
        yield [Type::int(), 'non-negative-int'];
        yield [Type::int(), 'non-zero-int'];
        yield [Type::float(), 'float'];
        yield [Type::float(), 'double'];
        yield [Type::string(), 'string'];
        yield [Type::string(), 'class-string'];
        yield [Type::string(), 'trait-string'];
        yield [Type::string(), 'interface-string'];
        yield [Type::string(), 'callable-string'];
        yield [Type::string(), 'numeric-string'];
        yield [Type::string(), 'lowercase-string'];
        yield [Type::string(), 'non-empty-lowercase-string'];

Review comment (suggestion):
```suggestion
        yield [Type::array(key: Type::union(Type::int(), Type::string())), DummyWithConstants::class.'::DUMMY_ARRAY_*'];
```
Is a bit more explicit to me :slightly_smiling_face: 

Code after:

        // object shape
        yield [Type::object(), 'object{foo: true, bar: false}'];

        // this
        yield [Type::object(Dummy::class), '$this', $typeContextFactory->createFromClassName(Dummy::class, AbstractDummy::class)];

        // const
        yield [Type::array(), 'array[1, 2, 3]'];
        yield [Type::false(), 'false'];
        yield [Type::float(), '1.23'];
        yield [Type::int(), '1'];
        yield [Type::null(), 'null'];
        yield [Type::string(), '"string"'];
        yield [Type::true(), 'true'];

        // const fetch
        yield [Type::string(), DummyWithConstants::class.'::DUMMY_STRING_*'];
        yield [Type::string(), DummyWithConstants::class.'::DUMMY_STRING_A'];
        yield [Type::int(), DummyWithConstants::class.'::DUMMY_INT_*'];
        yield [Type::int(), DummyWithConstants::class.'::DUMMY_INT_A'];
        yield [Type::float(), DummyWithConstants::class.'::DUMMY_FLOAT_*'];
        yield [Type::true(), DummyWithConstants::class.'::DUMMY_TRUE_*'];
        yield [Type::false(), DummyWithConstants::class.'::DUMMY_FALSE_*'];
        yield [Type::null(), DummyWithConstants::class.'::DUMMY_NULL_*'];
        yield [Type::array(null, Type::union(Type::int(), Type::string())), DummyWithConstants::class.'::DUMMY_ARRAY_*'];
        yield [Type::enum(DummyEnum::class, Type::string()), DummyWithConstants::class.'::DUMMY_ENUM_*'];
        yield [Type::union(Type::enum(DummyEnum::class, Type::string()), Type::array(Type::mixed(), Type::union(Type::int(), Type::string())), Type::string(), Type::int(), Type::float(), Type::bool(), Type::null()), DummyWithConstants::class.'::DUMMY_MIX_*'];

        // identifiers
        yield [Type::bool(), 'bool'];
        yield [Type::bool(), 'boolean'];
        yield [Type::true(), 'true'];
        yield [Type::false(), 'false'];
        yield [Type::int(), 'int'];
        yield [Type::int(), 'integer'];
        yield [Type::int(), 'positive-int'];
        yield [Type::int(), 'negative-int'];
        yield [Type::int(), 'non-positive-int'];
        yield [Type::int(), 'non-negative-int'];
        yield [Type::int(), 'non-zero-int'];
        yield [Type::float(), 'float'];
        yield [Type::float(), 'double'];
        yield [Type::string(), 'string'];
        yield [Type::string(), 'class-string'];
        yield [Type::string(), 'trait-string'];
        yield [Type::string(), 'interface-string'];
        yield [Type::string(), 'callable-string'];
        yield [Type::string(), 'numeric-string'];
        yield [Type::string(), 'lowercase-string'];
        yield [Type::string(), 'non-empty-lowercase-string'];