1616use Symfony \Component \Console \Input \InputInterface ;
1717use Symfony \Component \Console \Output \OutputInterface ;
1818use Symfony \Component \Filesystem \Filesystem ;
19+ use Symfony \Component \Finder \Finder ;
1920use Symfony \Component \Process \ProcessBuilder ;
2021
2122class PHPDocCommand extends AbstractMoodleCommand
@@ -34,6 +35,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
3435 {
3536 parent ::initialize ($ input , $ output );
3637 $ this ->initializeExecute ($ output , $ this ->getHelper ('process ' ));
38+ $ this ->finder = Finder::create ()->name ('*.php ' );
3739 }
3840
3941 protected function execute (InputInterface $ input , OutputInterface $ output )
@@ -50,11 +52,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
5052 $ filesystem ->mirror ($ plugin ->directory , $ directory );
5153 }
5254
55+ $ files = $ this ->plugin ->getFiles ($ this ->finder );
56+ if (count ($ files ) === 0 ) {
57+ return $ this ->outputSkip ($ output );
58+ }
59+
5360 $ process = $ this ->execute ->passThroughProcess (
5461 ProcessBuilder::create ()
5562 ->setPrefix ('php ' )
5663 ->add ('local/moodlecheck/cli/moodlecheck.php ' )
57- ->add ('-p= ' .$ this -> plugin -> directory )
64+ ->add ('-p= ' .implode ( ' , ' , $ files ) )
5865 ->add ('-f=text ' )
5966 ->setTimeout (null )
6067 ->setWorkingDirectory ($ this ->moodle ->directory )
0 commit comments