66use Symfony \Component \Console \Command \Command ;
77use Symfony \Component \Console \Input \InputArgument ;
88use Symfony \Component \Console \Input \InputInterface ;
9+ use Symfony \Component \Console \Input \InputOption ;
910use Symfony \Component \Console \Output \OutputInterface ;
1011
1112class PhpCommand extends Command
@@ -16,13 +17,20 @@ protected function configure()
1617 $ this ->setName ("php " );
1718 $ this ->setDescription ("Runs the PHP CLI built from source " );
1819
19- $ this ->addArgument ("args " , InputArgument::IS_ARRAY | InputArgument::REQUIRED , "arguments to pass to the PHP CLI " );
20+ $ this ->addOption ("info " , "-i " , InputOption::VALUE_NONE , "show PHP information " );
21+ 22+ $ this ->addArgument ("args " , InputArgument::IS_ARRAY , "arguments to pass to the PHP CLI " );
2023 }
2124
2225 protected function execute (InputInterface $ input , OutputInterface $ output )
2326 {
27+ $ arguments = $ input ->getArgument ('args ' );
28+ if ($ input ->hasOption ('info ' )) {
29+ $ arguments [] = '-i ' ;
30+ }
31+ 2432 $ dockerImage = new DockerImage ();
25- $ process = $ dockerImage ->createProcess ('run-cli ' , $ input -> getArgument ( ' args ' ) );
33+ $ process = $ dockerImage ->createProcess ('run-cli ' , $ arguments );
2634 $ process ->setTimeout (null );
2735
2836 return ConsoleProcessBridge::runProcessFromConsole ($ process , $ input , $ output );
0 commit comments