File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,11 @@ public function getRunner(?object $application): RunnerInterface
162
162
163
163
if (!$ application ->getName () || !$ console ->has ($ application ->getName ())) {
164
164
$ application ->setName ($ _SERVER ['argv ' ][0 ]);
165
- $ console ->add ($ application );
165
+ if (method_exists ($ console , 'addCommand ' )) {
166
+ $ console ->addCommand ($ application );
167
+ } else {
168
+ $ console ->add ($ application );
169
+ }
166
170
}
167
171
168
172
$ console ->setDefaultCommand ($ application ->getName (), true );
Original file line number Diff line number Diff line change 25
25
});
26
26
27
27
$ app = new Application ();
28
- $ app ->add ($ command );
28
+ if (method_exists ($ app , 'addCommand ' )) {
29
+ $ app ->addCommand ($ command );
30
+ } else {
31
+ $ app ->add ($ command );
32
+ }
29
33
$ app ->setDefaultCommand ('go ' , true );
30
34
31
35
return $ app ;
Original file line number Diff line number Diff line change 23
23
$ command ->setName ('my_command ' );
24
24
25
25
[$ cmd , $ args ] = $ runtime ->getResolver (require __DIR__ .'/command.php ' )->resolve ();
26
- $ app ->add ($ cmd (...$ args ));
26
+ if (method_exists ($ app , 'addCommand ' )) {
27
+ $ app ->addCommand ($ cmd (...$ args ));
28
+ } else {
29
+ $ app ->add ($ cmd (...$ args ));
30
+ }
27
31
28
32
return $ app ;
29
33
};
You can’t perform that action at this time.
0 commit comments