-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 6.0: Fix CS Fix CS quote address names if they contain parentheses [FrameworkBundle] Fail gracefully when forms use disabled CSRF [Mime] Fix inline parts when added via attachPart() Fail gracefully when attempting to autowire composite types [VarDumper] Add a test case for nesting intersection and union types Fix #46592 - Ignore getter with required parameters [Serializer] Fix inconsistent behaviour of nullable objects in key/value arrays
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
use Symfony\Component\VarDumper\Tests\Fixtures\ReflectionIntersectionTypeFixture; | ||
use Symfony\Component\VarDumper\Tests\Fixtures\ReflectionNamedTypeFixture; | ||
use Symfony\Component\VarDumper\Tests\Fixtures\ReflectionUnionTypeFixture; | ||
use Symfony\Component\VarDumper\Tests\Fixtures\ReflectionUnionTypeWithIntersectionFixture; | ||
|
||
/** | ||
* @author Nicolas Grekas <[email protected]> | ||
|
@@ -94,7 +95,7 @@ public function testClosureCaster() | |
$b: & 123 | ||
} | ||
file: "%sReflectionCasterTest.php" | ||
line: "87 to 87" | ||
line: "88 to 88" | ||
} | ||
EOTXT | ||
, $var | ||
|
@@ -318,6 +319,44 @@ public function testReflectionIntersectionType() | |
); | ||
} | ||
|
||
/** | ||
* @requires PHP 8.2 | ||
*/ | ||
public function testReflectionUnionTypeWithIntersection() | ||
{ | ||
$var = (new \ReflectionProperty(ReflectionUnionTypeWithIntersectionFixture::class, 'a'))->getType(); | ||
$this->assertDumpMatchesFormat( | ||
<<<'EOTXT' | ||
ReflectionUnionType { | ||
allowsNull: true | ||
types: array:2 [ | ||
0 => ReflectionIntersectionType { | ||
allowsNull: false | ||
types: array:2 [ | ||
0 => ReflectionNamedType { | ||
name: "Traversable" | ||
allowsNull: false | ||
isBuiltin: false | ||
} | ||
1 => ReflectionNamedType { | ||
name: "Countable" | ||
allowsNull: false | ||
isBuiltin: false | ||
} | ||
] | ||
} | ||
1 => ReflectionNamedType { | ||
name: "null" | ||
allowsNull: true | ||
isBuiltin: true | ||
} | ||
] | ||
} | ||
EOTXT | ||
, $var | ||
); | ||
} | ||
|
||
public function testExtendsReflectionType() | ||
{ | ||
$var = new ExtendsReflectionTypeFixture(); | ||
|
8 changes: 8 additions & 0 deletions
8
Tests/Fixtures/ReflectionUnionTypeWithIntersectionFixture.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\VarDumper\Tests\Fixtures; | ||
|
||
class ReflectionUnionTypeWithIntersectionFixture | ||
{ | ||
public (\Traversable&\Countable)|null $a; | ||
} |