Exemplo n.º 1
0
 /**
  * @param string $file
  * @param string $standard
  *
  * @return Process
  */
 private function execute($file, $standard)
 {
     $processBuilder = new ProcessBuilder(['php', $this->toolPathFinder->find('phpcs'), '--standard=' . $standard, $file]);
     $process = $processBuilder->getProcess();
     $process->run();
     return $process;
 }
Exemplo n.º 2
0
 /**
  * @param string $file
  *
  * @return Process
  */
 private function execute($file)
 {
     $processBuilder = new ProcessBuilder(['php', $this->toolPathFinder->find('jsonlint'), $file]);
     $process = $processBuilder->getProcess();
     $process->run();
     return $process;
 }
Exemplo n.º 3
0
 /**
  * @param string $file
  * @param string $options
  *
  * @return Process
  */
 private function execute($file, $options)
 {
     $command = sprintf('php %s %s text ./PmdRules.xml %s', $this->toolPathFinder->find('phpmd'), $file, $options);
     $process = new Process($command);
     $process->run();
     return $process;
 }
 /**
  * @param string $file
  * @param string $level
  *
  * @return Process
  */
 private function processTool($file, $level)
 {
     $processBuilder = new ProcessBuilder(['php', $this->toolPathFinder->find('php-cs-fixer'), '--dry-run', 'fix', $file, '--level=' . $level]);
     $process = $processBuilder->getProcess();
     $process->run();
     return $process;
 }
 /**
  * @return float
  */
 public function process()
 {
     $tool = $this->toolPathFinder->find('phpunit');
     $command = 'php ' . $tool . ' --coverage-text|grep Classes|cut -d " " -f 4|cut -d "%" -f 1';
     $process = new Process($command);
     $process->run();
     return (double) $process->getOutput();
 }
 /**
  * @param string $file
  * @param string $level
  * @param string $options
  *
  * @return Process
  */
 private function processTool($file, $level, $options)
 {
     $arguments = ['php', $this->toolPathFinder->find('php-cs-fixer'), '--dry-run', 'fix', $file, '--level=' . $level];
     if (null !== $options) {
         $arguments = array_merge($arguments, explode(' ', trim($options)));
     }
     $processBuilder = new ProcessBuilder($arguments);
     $process = $processBuilder->getProcess();
     $process->run();
     return $process;
 }