8000 Support multiple builtinType (union types) · symfony/symfony@16eee13 · GitHub
[go: up one dir, main page]

Skip to content

Commit 16eee13

Browse files
committed
Support multiple builtinType (union types)
1 parent 57e39b4 commit 16eee13

12 files changed

+193
-150
lines changed

UPGRADE-5.3.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
UPGRADE FROM 5.2 to 5.3
2+
=======================
3+
4+
PropertyInfo
5+
------------
6+
7+
* Deprecated `$builtinType` string type (first argument of `Type::__construct`
8+
method), you should use it as an array.

src/Symfony/Component/PropertyInfo/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
CHANGELOG
22
=========
33

4+
5.3.0
5+
-----
6+
7+
* Added ability to have union types in `Type` class.
8+
* Deprecated `$builtinType` string type (first argument of `Type::__construct`
9+
method), you should use it as an array.
10+
411
5.2.0
512
-----
613

src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function getTypes(string $class, string $property, array $context = []):
158158
return $types;
159159
}
160160

161-
return [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), $types[0])];
161+
return [new Type([Type::BUILTIN_TYPE_ARRAY], false, null, true, new Type([Type::BUILTIN_TYPE_INT]), $types[0])];
162162
}
163163

164164
/**

src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ private function extractFromMutator(string $class, string $property): ?array
466466
$type = $this->extractFromReflectionType($reflectionType, $reflectionMethod->getDeclaringClass());
467467

468468
if (1 === \count($type) && \in_array($prefix, $this->arrayMutatorPrefixes)) {
469-
$type = [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), $type[0])];
469+
$type = [new Type([Type::BUILTIN_TYPE_ARRAY], false, null, true, new Type([Type::BUILTIN_TYPE_INT]), $type[0])];
470470
}
471471

472472
return $type;
@@ -489,7 +489,7 @@ private function extractFromAccessor(string $class, string $property): ?array
489489
}
490490

491491
if (\in_array($prefix, ['is', 'can', 'has'])) {
492-
return [new Type(Type::BUILTIN_TYPE_BOOL)];
492+
return [new Type([Type::BUILTIN_TYPE_BOOL])];
493493
}
494494

495495
return null;
@@ -547,7 +547,7 @@ private function extractFromDefaultValue(string $class, string $property): ?arra
547547
$type = \gettype($defaultValue);
548548
$type = static::MAP_TYPES[$type] ?? $type;
549549

550-
return [new Type($type, false, null, Type::BUILTIN_TYPE_ARRAY === $type)];
550+
return [new Type([$type], false, 10000 null, Type::BUILTIN_TYPE_ARRAY === $type)];
551551
}
552552

553553
private function extractFromReflectionType(\ReflectionType $reflectionType, \ReflectionClass $declaringClass): array
@@ -562,13 +562,13 @@ private function extractFromReflectionType(\ReflectionType $reflectionType, \Ref
562562
}
563563

564564
if (Type::BUILTIN_TYPE_ARRAY === $phpTypeOrClass) {
565-
$types[] = new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true);
565+
$types[] = new Type([Type::BUILTIN_TYPE_ARRAY], $nullable, null, true);
566566
} elseif ('void' === $phpTypeOrClass) {
567-
$types[] = new Type(Type::BUILTIN_TYPE_NULL, $nullable);
567+
$types[] = new Type([Type::BUILTIN_TYPE_NULL], $nullable);
568568
} elseif ($type->isBuiltin()) {
569-
$types[] = new Type($phpTypeOrClass, $nullable);
569+
$types[] = new Type([$phpTypeOrClass], $nullable);
570570
} else {
571-
$types[] = new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, $this->resolveTypeName($phpTypeOrClass, $declaringClass));
571+
$types[] = new Type([Type::BUILTIN_TYPE_OBJECT], $nullable, $this->resolveTypeName($phpTypeOrClass, $declaringClass));
572572
}
573573
}
574574

src/Symfony/Component/PropertyInfo/Tests/AbstractPropertyInfoExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testGetLongDescription()
5555

5656
public function testGetTypes()
5757
{
58-
$this->assertEquals([new Type(Type::BUILTIN_TYPE_INT)], $this->propertyInfo->getTypes('Foo', 'bar', []));
58+
$this->assertEquals([new Type([Type::BUILTIN_TYPE_INT])], $this->propertyInfo->getTypes('Foo', 'bar', []));
5959
}
6060

6161
public function testIsReadable()

src/Symfony/Component/PropertyInfo/Tests/Extractor/ConstructorExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testInstanceOf()
3838

3939
public function testGetTypes()
4040
{
41-
$this->assertEquals([new Type(Type::BUILTIN_TYPE_STRING)], $this->extractor->getTypes('Foo', 'bar', []));
41+
$this->assertEquals([new Type([Type::BUILTIN_TYPE_STRING])], $this->extractor->getTypes('Foo', 'bar', []));
4242
}
4343

4444
public function testGetTypes_ifNoExtractors()

src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php

Lines changed: 82 additions & 82 deletions
Large diffs are not rendered by default.

src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php

Lines changed: 36 additions & 36 deletions
< 10000 td data-grid-cell-id="diff-9ce00a2b3bd04208cc0a4ea08b3bbab5ff1f8f616661a11b39b260cc842109ca-233-229-2" data-line-anchor="diff-9ce00a2b3bd04208cc0a4ea08b3bbab5ff1f8f616661a11b39b260cc842109caL233" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-deletionLine-bgColor, var(--diffBlob-deletion-bgColor-line));padding-right:24px" tabindex="-1" valign="top" class="focusable-grid-cell diff-text-cell left-side-diff-cell border-right left-side">-
['baz', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING))]],
Original file line numberDiff line numberDiff line change
@@ -181,18 +181,18 @@ public function typesProvider()
181181
{
182182
return [
183183
['a', null],
184-
['b', [new Type(Type::BUILTIN_TYPE_OBJECT, true, 'Symfony\Component\PropertyInfo\Tests\Fixtures\ParentDummy')]],
185-
['c', [new Type(Type::BUILTIN_TYPE_BOOL)]],
186-
['d', [new Type(Type::BUILTIN_TYPE_BOOL)]],
184+
['b', [new Type([Type::BUILTIN_TYPE_OBJECT], true, 'Symfony\Component\PropertyInfo\Tests\Fixtures\ParentDummy')]],
185+
['c', [new Type([Type::BUILTIN_TYPE_BOOL])]],
186+
['d', [new Type([Type::BUILTIN_TYPE_BOOL])]],
187187
['e', null],
188-
['f', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTime'))]],
188+
['f', [new Type([Type::BUILTIN_TYPE_ARRAY], false, null, true, new Type([Type::BUILTIN_TYPE_INT]), new Type([Type::BUILTIN_TYPE_OBJECT], false, 'DateTime'))]],
189189
['donotexist', null],
190190
['staticGetter', null],
191191
['staticSetter', null],
192-
['self', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy')]],
193-
['realParent', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Component\PropertyInfo\Tests\Fixtures\ParentDummy')]],
194-
['date', [new Type(Type::BUILTIN_TYPE_OBJECT, false, \DateTime::class)]],
195-
['dates', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, \DateTime::class))]],
192+
['self', [new Type([Type::BUILTIN_TYPE_OBJECT], false, 'Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy')]],
193+
['realParent', [new Type([Type::BUILTIN_TYPE_OBJECT], false, 'Symfony\Component\PropertyInfo\Tests\Fixtures\ParentDummy')]],
194+
['date', [new Type([Type::BUILTIN_TYPE_OBJECT], false, \DateTime::class)]],
195+
['dates', [new Type([Type::BUILTIN_TYPE_ARRAY], false, null, true, new Type([Type::BUILTIN_TYPE_INT]), new Type([Type::BUILTIN_TYPE_OBJECT], false, \DateTime::class))]],
196196
];
197197
}
198198

@@ -207,11 +207,11 @@ public function testExtractPhp7Type($property, array $type = null)
207207
public function php7TypesProvider()
208208
{
209209
return [
210-
['foo', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true)]],
211-
['bar', [new Type(Type::BUILTIN_TYPE_INT)]],
212-
['baz', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING))]],
213-
['buz', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Symfony\Component\PropertyInfo\Tests\Fixtures\Php7Dummy')]],
214-
['biz', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'stdClass')]],
210+
['foo', [new Type([Type::BUILTIN_TYPE_ARRAY], false, null, true)]],
211+
['bar', [new Type([Type::BUILTIN_TYPE_INT])]],
212+
['baz', [new Type([Type::BUILTIN_TYPE_ARRAY], false, null, true, new Type([Type::BUILTIN_TYPE_INT]), new Type([Type::BUILTIN_TYPE_STRING]))]],
213+
['buz', [new Type([Type::BUILTIN_TYPE_OBJECT], false, 'Symfony\Component\PropertyInfo\Tests\Fixtures\Php7Dummy')]],
214+
['biz', [new Type([Type::BUILTIN_TYPE_OBJECT], false, 'stdClass')]],
215215
['donotexist', null],
216216
];
217217
}
@@ -227,10 +227,10 @@ public function testExtractPhp71Type($property, array $type = null)
227227
public function php71TypesProvider()
228228
{
229229
return [
230-
['foo', [new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)]],
231-
['buz', [new Type(Type::BUILTIN_TYPE_NULL)]],
232-
['bar', [new Type(Type::BUILTIN_TYPE_INT, true)]],
233
230+
['foo', [new Type([Type::BUILTIN_TYPE_ARRAY], true, null, true)]],
231+
['buz', [new Type([Type::BUILTIN_TYPE_NULL])]],
232+
['bar', [new Type([Type::BUILTIN_TYPE_INT], true)]],
233+
['baz', [new Type([Type::BUILTIN_TYPE_ARRAY], false, null, true, new Type([Type::BUILTIN_TYPE_INT]), new Type([Type::BUILTIN_TYPE_STRING]))]],
234234
['donotexist', null],
235235
];
236236
}
@@ -247,11 +247,11 @@ public function testExtractPhp80Type($property, array $type = null)
247247
public function php80TypesProvider()
248248
{
249249
return [
250-
['foo', [new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true)]],
251-
['bar', [new Type(Type::BUILTIN_TYPE_INT, true)]],
252-
['timeout', [new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_FLOAT)]],
253-
['optional', [new Type(Type::BUILTIN_TYPE_INT, true), new Type(Type::BUILTIN_TYPE_FLOAT, true)]],
254-
['string', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'Stringable'), new Type(Type::BUILTIN_TYPE_STRING)]],
250+
['foo', [new Type([Type::BUILTIN_TYPE_ARRAY], true, null, true)]],
251+
['bar', [new Type([Type::BUILTIN_TYPE_INT], true)]],
252+
['timeout', [new Type([Type::BUILTIN_TYPE_INT]), new Type([Type::BUILTIN_TYPE_FLOAT])]],
253+
['optional', [new Type([Type::BUILTIN_TYPE_INT], true), new Type([Type::BUILTIN_TYPE_FLOAT], true)]],
254+
['string', [new Type([Type::BUILTIN_TYPE_OBJECT], false, 'Stringable'), new Type([Type::BUILTIN_TYPE_STRING])]],
255255
['payload', null],
256256
['data', null],
257257
];
@@ -268,10 +268,10 @@ public function testExtractWithDefaultValue($property, $type)
268268
public function defaultValueProvider()
269269
{
270270
return [
271-
['defaultInt', [new Type(Type::BUILTIN_TYPE_INT, false)]],
272-
['defaultFloat', [new Type(Type::BUILTIN_TYPE_FLOAT, false)]],
273-
['defaultString', [new Type(Type::BUILTIN_TYPE_STRING, false)]],
274-
['defaultArray', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true)]],
271+
['defaultInt', [new Type([Type::BUILTIN_TYPE_INT], false)]],
272+
['defaultFloat', [new Type([Type::BUILTIN_TYPE_FLOAT], false)]],
273+
['defaultString', [new Type([Type::BUILTIN_TYPE_STRING], false)]],
274+
['defaultArray', [new Type([Type::BUILTIN_TYPE_ARRAY], false, null, true)]],
275275
['defaultNull', null],
276276
];
277277
}
@@ -399,11 +399,11 @@ public function constructorTypesProvider(): array
399399
{
400400
return [
401401
// php71 dummy has following constructor: __construct(string $string, int $intPrivate)
402-
[Php71Dummy::class, 'string', [new Type(Type::BUILTIN_TYPE_STRING, false)]],
403-
[Php71Dummy::class, 'intPrivate', [new Type(Type::BUILTIN_TYPE_INT, false)]],
402+
[Php71Dummy::class, 'string', [new Type([Type::BUILTIN_TYPE_STRING], false)]],
403+
[Php71Dummy::class, 'intPrivate', [new Type([Type::BUILTIN_TYPE_INT], false)]],
404404
// Php71DummyExtended2 adds int $intWithAccessor
405-
[Php71DummyExtended2::class, 'intWithAccessor', [new Type(Type::BUILTIN_TYPE_INT, false)]],
406-
[Php71DummyExtended2::class, 'intPrivate', [new Type(Type::BUILTIN_TYPE_INT, false)]],
405+
[Php71DummyExtended2::class, 'intWithAccessor', [new Type([Type::BUILTIN_TYPE_INT], false)]],
406+
[Php71DummyExtended2::class, 'intPrivate', [new Type([Type::BUILTIN_TYPE_INT], false)]],
407407
[DefaultValue::class, 'foo', null],
408408
];
409409
}
@@ -426,10 +426,10 @@ public function testNullOnPrivateProtectedAccessor()
426426
*/
427427
public function testTypedProperties(): void
428428
{
429-
$this->assertEquals([new Type(Type::BUILTIN_TYPE_OBJECT, false, Dummy::class)], $this->extractor->getTypes(Php74Dummy::class, 'dummy'));
430-
$this->assertEquals([new Type(Type::BUILTIN_TYPE_BOOL, true)], $this->extractor->getTypes(Php74Dummy::class, 'nullableBoolProp'));
431-
$this->assertEquals([new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING))], $this->extractor->getTypes(Php74Dummy::class, 'stringCollection'));
432-
$this->assertEquals([new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true)], $this->extractor->getTypes(Php74Dummy::class, 'collection'));
429+
$this->assertEquals([new Type([Type::BUILTIN_TYPE_OBJECT], false, Dummy::class)], $this->extractor->getTypes(Php74Dummy::class, 'dummy'));
430+
$this->assertEquals([new Type([Type::BUILTIN_TYPE_BOOL], true)], $this->extractor->getTypes(Php74Dummy::class, 'nullableBoolProp'));
431+
$this->assertEquals([new Type([Type::BUILTIN_TYPE_ARRAY], false, null, true, new Type([Type::BUILTIN_TYPE_INT]), new Type([Type::BUILTIN_TYPE_STRING]))], $this->extractor->getTypes(Php74Dummy::class, 'stringCollection'));
432+
$this->assertEquals([new Type([Type::BUILTIN_TYPE_ARRAY], false, null, true)], $this->extractor->getTypes(Php74Dummy::class, 'collection'));
433433
}
434434

435435
/**
@@ -572,10 +572,10 @@ public function testExtractConstructorTypes(string $property, array $type = null
572572
public function extractConstructorTypesProvider(): array
573573
{
574574
return [
575-
['timezone', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTimeZone')]],
575+
['timezone', [new Type([Type::BUILTIN_TYPE_OBJECT], false, 'DateTimeZone')]],
576576
['date', null],
577577
['dateObject', null],
578-
['dateTime', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTime')]],
578+
['dateTime', [new Type([Type::BUILTIN_TYPE_OBJECT], false, 'DateTime')]],
579579
['ddd', null],
580580
];
581581
}

src/Symfony/Component/PropertyInfo/Tests/Fixtures/DummyExtractor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ public function getLongDescription($class, $property, array $context = []): ?str
4545
*/
4646
public function getTypes($class, $property, array $context = []): ?array
4747
{
48-
return [new Type(Type::BUILTIN_TYPE_INT)];
48+
return [new Type([Type::BUILTIN_TYPE_INT])];
4949
}
5050

5151
/**
5252
* {@inheritdoc}
5353
*/
5454
public function getTypesFromConstructor(string $class, string $property): ?array
5555
{
56-
return [new Type(Type::BUILTIN_TYPE_STRING)];
56+
return [new Type([Type::BUILTIN_TYPE_STRING])];
5757
}
5858

5959
/**

src/Symfony/Component/PropertyInfo/Tests/TypeTest.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,35 @@ class TypeTest extends TestCase
2121
{
2222
public function testConstruct()
2323
{
24-
$type = new Type('object', true, 'ArrayObject', true, new Type('int'), new Type('string'));
24+
$type = new Type(['object'], true, 'ArrayObject', true, new Type(['int']), new Type(['string']));
2525

26-
$this->assertEquals(Type::BUILTIN_TYPE_OBJECT, $type->getBuiltinType());
26+
$this->assertEquals([Type::BUILTIN_TYPE_OBJECT], $type->getBuiltinTypes());
2727
$this->assertTrue($type->isNullable());
2828
$this->assertEquals('ArrayObject', $type->getClassName());
2929
$this->assertTrue($type->isCollection());
3030

3131
$collectionKeyType = $type->getCollectionKeyType();
3232
$this->assertInstanceOf('Symfony\Component\PropertyInfo\Type', $collectionKeyType);
33-
$this->assertEquals(Type::BUILTIN_TYPE_INT, $collectionKeyType->getBuiltinType());
33+
$this->assertEquals([Type::BUILTIN_TYPE_INT], $collectionKeyType->getBuiltinTypes());
3434

3535
$collectionValueType = $type->getCollectionValueType();
3636
$this->assertInstanceOf('Symfony\Component\PropertyInfo\Type', $collectionValueType);
37-
$this->assertEquals(Type::BUILTIN_TYPE_STRING, $collectionValueType->getBuiltinType());
37+
$this->assertEquals([Type::BUILTIN_TYPE_STRING], $collectionValueType->getBuiltinTypes());
38+
39+
$type = new Type(['string', 'int']);
40+
$this->assertEquals([Type::BUILTIN_TYPE_STRING, Type::BUILTIN_TYPE_INT], $type->getBuiltinTypes());
3841
}
3942

4043
public function testIterable()
4144
{
42-
$type = new Type('iterable');
43-
$this->assertSame('iterable', $type->getBuiltinType());
45+
$type = new Type(['iterable']);
46+
$this->assertSame(['iterable'], $type->getBuiltinTypes());
4447
}
4548

4649
public function testInvalidType()
4750
{
4851
$this->expectException('InvalidArgumentException');
4952
$this->expectExceptionMessage('"foo" is not a valid PHP type.');
50-
new Type('foo');
53+
new Type(['foo']);
5154
}
5255
}

src/Symfony/Component/PropertyInfo/Type.php

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Type
4949
self::BUILTIN_TYPE_ITERABLE,
5050
];
5151

52-
private $builtinType;
52+
private $builtinTypeList;
5353
private $nullable;
5454
private $class;
5555
private $collection;
@@ -59,13 +59,24 @@ class Type
5959
/**
6060
* @throws \InvalidArgumentException
6161
*/
62-
public function __construct(string $builtinType, bool $nullable = false, string $class = null, bool $collection = false, self $collectionKeyType = null, self $collectionValueType = null)
62+
public function __construct(/* array */ $builtinType, bool $nullable = false, string $class = null, bool $collection = false, self $collectionKeyType = null, self $collectionValueType = null)
6363
{
64-
if (!\in_array($builtinType, self::$builtinTypes)) {
65-
throw new \InvalidArgumentException(sprintf('"%s" is not a valid PHP type.', $builtinType));
64+
if (\is_string($builtinType)) {
65+
trigger_deprecation('symfony/property-info', '5.3', 'The "$builtinType" argument should be an "array".');
66+
$builtinType = [$builtinType];
6667
}
6768

68-
$this->builtinType = $builtinType;
69+
if (!\is_array($builtinTypeList = $builtinType)) {
70+
throw new \TypeError('"$builtinType" should be an array.');
71+
}
72+
73+
foreach ($builtinTypeList as $builtinType) {
74+
if (!\in_array($builtinType, self::$builtinTypes)) {
75+
throw new \InvalidArgumentException(sprintf('"%s" is not a valid PHP type.', $builtinType));
76+
}
77+
}
78+
79+
$this->builtinTypeList = $builtinTypeList;
6980
$this->nullable = $nullable;
7081
$this->class = $class;
7182
$this->collection = $collection;
@@ -80,7 +91,21 @@ public function __construct(string $builtinType, bool $nullable = false, string
8091
*/
8192
public function getBuiltinType(): string
8293
{
83-
return $this->builtinType;
94+
trigger_deprecation('symfony/property-info', '5.3', 'The "$builtinType" argument is now an array, you should use "getBuiltinTypes()".');
95+
96+
[$builtinType] = $this->builtinTypeList;
97+
98+
return $builtinType;
99+
}
100+
101+
/**
102+
* Gets built-in types.
103+
*
104+
* Returns an array that can be bool, int, float, string, array, object, resource, null, callback or iterable.
105+
*/
106+
public function getBuiltinTypes(): array
107+
{
108+
return $this->builtinTypeList;
84109
}
85110

86111
public function isNullable(): bool

0 commit comments

Comments
 (0)
0