Exemplo n.º 1
0
 protected function convertFile(InputInterface $input)
 {
     $converter = new Converter($input->getArgument('source'));
     $destination = $input->getArgument('destination');
     if (file_exists($destination) && !$input->getOption('overwrite')) {
         throw InvalidParameter::destinationExist();
     }
     $converter->saveAsPhp5($destination);
 }
Exemplo n.º 2
0
 /**
  * @param string $filePath
  */
 protected function convertToPhp5($filePath)
 {
     $converter = new Converter($filePath);
     $converter->saveAsPhp5($filePath);
 }
Exemplo n.º 3
0
 /**
  * @param array $php7statements
  *
  * @return \PhpParser\Node[]
  */
 public function convertToPhp5Statements(array $php7statements)
 {
     $converter = Converter::getTraverser($php7statements);
     $php5Statements = $converter->traverse($php7statements);
     return $php5Statements;
 }