File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed
Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 4545 "phpunit/php-timer" : " ^7.0.1" ,
4646 "phpunit/phpunit" : " ^11.5.24" ,
4747 "sebastian/environment" : " ^7.2.1" ,
48- "symfony/console" : " ^6.4.22 || ^7.3.0" ,
49- "symfony/process" : " ^6.4.20 || ^7.3.0"
48+ "symfony/console" : " ^6.4.22 || ^7.3.4 || ^8.0. 0" ,
49+ "symfony/process" : " ^6.4.20 || ^7.3.4 || ^8.0. 0"
5050 },
5151 "require-dev" : {
5252 "ext-pcov" : " *" ,
5757 "phpstan/phpstan-phpunit" : " ^2.0.6" ,
5858 "phpstan/phpstan-strict-rules" : " ^2.0.4" ,
5959 "squizlabs/php_codesniffer" : " ^3.13.2" ,
60- "symfony/filesystem" : " ^6.4.13 || ^7.3.0"
60+ "symfony/filesystem" : " ^6.4.13 || ^7.3.2 || ^8.0. 0"
6161 },
6262 "autoload" : {
6363 "psr-4" : {
Original file line number Diff line number Diff line change 1818use function class_exists ;
1919use function is_string ;
2020use function is_subclass_of ;
21+ use function method_exists ;
2122use function sprintf ;
2223
2324/** @internal */
@@ -45,7 +46,14 @@ public static function applicationFactory(string $cwd): Application
4546
4647 $ application ->setName ('ParaTest ' );
4748 $ application ->setVersion (PrettyVersions::getVersion ('brianium/paratest ' )->getPrettyVersion ());
48- $ application ->add ($ command );
49+ // @phpstan-ignore function.alreadyNarrowedType (can be removed when dropping support for Symfony 7.3)
50+ if (method_exists ($ application , 'addCommand ' )) {
51+ $ application ->addCommand ($ command );
52+ } else {
53+ // @phpstan-ignore method.deprecated (can be removed when dropping support for Symfony 7.3)
54+ $ application ->add ($ command );
55+ }
56+
4957 $ commandName = $ command ->getName ();
5058 assert ($ commandName !== null );
5159 $ application ->setDefaultCommand ($ commandName , true );
Original file line number Diff line number Diff line change 1616use function assert ;
1717use function chdir ;
1818use function getcwd ;
19+ use function method_exists ;
1920use function uniqid ;
2021
2122/** @internal */
@@ -36,7 +37,13 @@ protected function setUp(): void
3637 $ this ->tmpDir = (new TmpDirCreator ())->create ();
3738 chdir ($ this ->tmpDir );
3839 $ application = ParaTestCommand::applicationFactory ($ this ->tmpDir );
39- $ application ->add (new HelpCommand ());
40+ // @phpstan-ignore function.alreadyNarrowedType (can be removed when dropping support for Symfony 7.3)
41+ if (method_exists ($ application , 'addCommand ' )) {
42+ $ application ->addCommand (new HelpCommand ());
43+ } else {
44+ // @phpstan-ignore method.deprecated (can be removed when dropping support for Symfony 7.3)
45+ $ application ->add (new HelpCommand ());
46+ }
4047
4148 $ this ->commandTester = new CommandTester ($ application ->find (ParaTestCommand::COMMAND_NAME ));
4249 }
You can’t perform that action at this time.
0 commit comments