This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
16
{
17
/**
18
* @var string
19
*
20
* Command name
21
*/
22
const COMMAND_NAME = 'fix';
23
24
/**
25
* configure
26
*/
27
protected function configure()
28
{
29
$this
30
->setName('fix')
31
->setDescription('Adds backslashes to all internal PHP functions')
32
->addArgument(
33
'path',
34
InputArgument::REQUIRED,
35
'Path'
36
);
37
}
38
39
/**
40
* Execute command
41
*
42
* @param InputInterface $input Input
43
* @param OutputInterface $output Output
44
*
45
* @return \int|\\null|void
46
*
47
* @throws Exception
48
*/
49
protected function execute(InputInterface $input, OutputInterface $output)
50
{
51
$path = $input->getArgument('path');
52
53
$fileSystem = new FileSystem();
54
$fileEditor = new FileEditor(new FileGenerator(), new FunctionRepository(), $fileSystem);
55
56
foreach ($fileSystem->getFilesFromPath($path) as $file) {
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.