File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
src/Symfony/Component/DependencyInjection/Tests
Fixtures/CheckTypeDeclarationsPass Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 3232use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \FooObject ;
3333use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \IntersectionConstructor ;
3434use 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 ;
3636use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \Waldo ;
3737use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \WaldoFoo ;
3838use Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass \Wobble ;
@@ -876,10 +876,14 @@ public function testUnionTypePassesWithTrue()
876876 {
877877 $ container = new ContainerBuilder ();
878878
879- $ container ->register ('union ' , UnionConstructorWithTrue ::class)
880- ->setFactory ([UnionConstructorWithTrue ::class, 'create ' ])
879+ $ container ->register ('unionTrue ' , UnionConstructorPHP82 ::class)
880+ ->setFactory ([UnionConstructorPHP82 ::class, 'create ' ])
881881 ->setArguments ([true ]);
882882
883+ $ container ->register ('unionNull ' , UnionConstructorPHP82::class)
884+ ->setFactory ([UnionConstructorPHP82::class, 'create ' ])
885+ ->setArguments ([null ]);
886+
883887 (new CheckTypeDeclarationsPass (true ))->process ($ container );
884888
885889 $ this ->addToAssertionCount (1 );
Original file line number Diff line number Diff line change 22
33namespace Symfony \Component \DependencyInjection \Tests \Fixtures \CheckTypeDeclarationsPass ;
44
5- class UnionConstructorWithTrue
5+ class UnionConstructorPHP82
66{
7- public static function create (array |true $ arg ): static
7+ public static function create (null |true $ arg ): static
88 {
99 return new static (0 );
1010 }
You can’t perform that action at this time.
0 commit comments