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); }
/** * @param string $filePath */ protected function convertToPhp5($filePath) { $converter = new Converter($filePath); $converter->saveAsPhp5($filePath); }
/** * @param array $php7statements * * @return \PhpParser\Node[] */ public function convertToPhp5Statements(array $php7statements) { $converter = Converter::getTraverser($php7statements); $php5Statements = $converter->traverse($php7statements); return $php5Statements; }