CreateModuleDiFile::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 14
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 14
loc 14
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
namespace N98\Magento\Command\Developer\Module\Create\SubCommand;
4
5
use N98\Magento\Command\SubCommand\AbstractSubCommand;
6
7 View Code Duplication
class CreateModuleDiFile extends AbstractSubCommand
0 ignored issues
show
Duplication introduced by
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...
8
{
9
    /**
10
     * @return boolean|null
11
     */
12
    public function execute()
13
    {
14
        $outFile = $this->config->getString('moduleDirectory') . '/etc/di.xml';
15
16
        \file_put_contents(
17
            $outFile,
18
            $this->getCommand()->getHelper('twig')->render(
19
                'dev/module/create/app/code/module/etc/di.xml.twig',
20
                $this->config->getArray('twigVars')
21
            )
22
        );
23
24
        $this->output->writeln('<info>Created file: <comment>' . $outFile . '<comment></info>');
25
    }
26
}
27