public function testItDoesNotBackSlashAliasedFunctions()
 {
     $this->fileEditor->addBackslashes($this->base . '/Resources/AliasedFunction.php');
     $output = $this->fileSystem->getFile($this->base . '/Resources/AliasedFunction.php');
     $this->assertContains('return stringLength($value);', $output);
     $this->assertContains('use function strlen as stringLength;', $output);
 }
Ejemplo n.º 2
0
 /**
  * Execute command
  *
  * @param InputInterface  $input  Input
  * @param OutputInterface $output Output
  *
  * @return \int|\\null|void
  *
  * @throws Exception
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $path = $input->getArgument('path');
     $fileSystem = new FileSystem();
     $fileEditor = new FileEditor(new FileGenerator(), new FunctionRepository(), $fileSystem);
     foreach ($fileSystem->getFilesFromPath($path) as $file) {
         $fileEditor->addBackslashes($file);
     }
     $output->write('Success! Backslashes added!', true);
     return $output;
 }