File tree 2 files changed +9
-5
lines changed
src/Symfony/Component/DependencyInjection/Tests
Fixtures/CheckTypeDeclarationsPass
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 32
32
use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \FooObject ;
33
33
use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \IntersectionConstructor ;
34
34
use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \UnionConstructor ;
35
- use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \UnionConstructorWithTrue ;
35
+ use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \UnionConstructorPHP82 ;
36
36
use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \Waldo ;
37
37
use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \WaldoFoo ;
38
38
use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \Wobble ;
@@ -876,10 +876,14 @@ public function testUnionTypePassesWithTrue()
876
876
{
877
877
$ container = new ContainerBuilder ();
878
878
879
- $ container ->register ('union ' , UnionConstructorWithTrue ::class)
880
- ->setFactory ([UnionConstructorWithTrue ::class, 'create ' ])
879
+ $ container ->register ('unionTrue ' , UnionConstructorPHP82 ::class)
880
+ ->setFactory ([UnionConstructorPHP82 ::class, 'create ' ])
881
881
->setArguments ([true ]);
882
882
883
+ $ container ->register ('unionNull ' , UnionConstructorPHP82::class)
884
+ ->setFactory ([UnionConstructorPHP82::class, 'create ' ])
885
+ ->setArguments ([null ]);
886
+
883
887
(new CheckTypeDeclarationsPass (true ))->process ($ container );
884
888
885
889
$ this ->addToAssertionCount (1 );
Original file line number Diff line number Diff line change 2
2
3
3
namespace Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass ;
4
4
5
- class UnionConstructorWithTrue
5
+ class UnionConstructorPHP82
6
6
{
7
- public static function create (array |true $ arg ): static
7
+ public static function create (null |true $ arg ): static
8
8
{
9
9
return new static (0 );
10
10
}
You can’t perform that action at this time.
0 commit comments