Passed
Push — master ( 2a39ec...3b6c56 )
by Andrea
03:42
created

GenerateFormCommand   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 182
Duplicated Lines 0 %

Test Coverage

Coverage 96.05%

Importance

Changes 0
Metric Value
wmc 9
eloc 135
dl 0
loc 182
ccs 73
cts 76
cp 0.9605
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getRoutingCode() 0 49 1
A generateFormWiew() 0 7 1
A generateFormRouting() 0 28 2
A configure() 0 7 1
A generateFormsDefaultTableValues() 0 17 1
A getControllerCode() 0 27 1
A execute() 0 33 2
1
<?php
2
3
namespace Fi\PannelloAmministrazioneBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputArgument;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
use Symfony\Component\Filesystem\Filesystem;
10
use Symfony\Component\Finder\Finder;
11
use Fi\OsBundle\DependencyInjection\OsFunctions;
12
13
class GenerateFormCommand extends ContainerAwareCommand
14
{
15
16
    protected $apppaths;
17
    protected $genhelper;
18
    protected $pammutils;
19
20 6
    protected function configure()
21
    {
22
        $this
23 6
                ->setName('pannelloamministrazione:generateformcrud')
24 6
                ->setDescription('Genera le views per il crud')
25 6
                ->setHelp('Genera le views per il crud, <br/>fifree.mwb Fi/CoreBundle default [--schemaupdate]<br/>')
26 6
                ->addArgument('entityform', InputArgument::REQUIRED, 'Il nome entity del form da creare');
27 6
    }
28 2
    protected function execute(InputInterface $input, OutputInterface $output)
29
    {
30 2
        set_time_limit(0);
31 2
        $this->apppaths = $this->getContainer()->get("pannelloamministrazione.projectpath");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal pannelloamministrazione.projectpath does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
32 2
        $pammutils = $this->getContainer()->get("pannelloamministrazione.utils");
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style Comprehensibility introduced by
The string literal pannelloamministrazione.utils does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
33
34 2
        $bundlename = "App";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal App does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
35 2
        $entityform = $input->getArgument('entityform');
36
37 2
        $phpPath = OsFunctions::getPHPExecutableFromPath();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
38 2
        $command = $phpPath . ' ' . $this->apppaths->getConsole() . ' --env=dev make:form ';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
39 2
        $resultcrud = $pammutils->runCommand($command . $entityform . "Type" . " " . $entityform);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Type does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Bug introduced by
Are you sure $entityform of type null|string|string[] can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

39
        $resultcrud = $pammutils->runCommand($command . /** @scrutinizer ignore-type */ $entityform . "Type" . " " . $entityform);
Loading history...
40 2
        if ($resultcrud['errcode'] == 0) {
41 2
            $fs = new Filesystem();
42
            //Controller
43 2
            $controlleFile = $this->apppaths->getSrcPath() . '/Controller/' . $entityform . 'Controller.php';
44 2
            $code = $this->getControllerCode(str_replace('/', '\\', $bundlename), $entityform);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 10 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
45 2
            $fs->dumpFile($controlleFile, $code);
46 2
            $output->writeln("<info>Creato " . $controlleFile . "</info>");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal <info>Creato does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal </info> does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
47
48
            //Routing
49 2
            $retmsg = $this->generateFormRouting($bundlename, $entityform);
50
            //Twig template (Crea i template per new edit show)
51 2
            $this->generateFormWiew($bundlename, $entityform, 'edit');
52 2
            $this->generateFormWiew($bundlename, $entityform, 'index');
53 2
            $this->generateFormWiew($bundlename, $entityform, 'new');
54
55 2
            $this->generateFormsDefaultTableValues($entityform);
56 2
            $output->writeln("<info>" . $retmsg . "</info>");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal <info> does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal </info> does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
57 2
            return 0;
58
        } else {
59
            $output->writeln("<error>" . $resultcrud['errmsg'] . "</error>");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal <error> does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal </error> does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
60
            return 1;
61
        }
62
    }
63 2
    private function generateFormRouting($bundlename, $entityform)
64
    {
65
        //Routing del form
66 2
        $fs = new Filesystem();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 10 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
67 2
        $routingFile = $this->apppaths->getSrcPath() . '/../config/routes/' . strtolower($entityform) . '.yml';
68
69 2
        $code = $this->getRoutingCode(str_replace('/', '', $bundlename), $entityform);
70 2
        $fs->dumpFile($routingFile, $code);
71
72
        //Fixed: Adesso questa parte la fa da solo symfony (05/2015)
73
        //Refixed dalla versione 2.8 non lo fa più (04/2016)
74
75 2
        $dest = $this->apppaths->getSrcPath() . '/../config/routes.yaml';
76
77 2
        $routingContext = str_replace('/', '', $bundlename) . '_' . $entityform . ':' . "\n" .
78 2
                '  resource: routes/' . strtolower($entityform) . '.yml' . "\n" .
79 2
                '  prefix: /' . $entityform . "\n\n";
80
81
        //Si fa l'append nel file routing del bundle per aggiungerci le rotte della tabella che stiamo gestendo
82 2
        $fh = file_get_contents($dest);
83 2
        if ($fh !== false) {
84 2
            file_put_contents($dest, $routingContext . $fh);
85 2
            $retmsg = 'Routing ' . $dest . " generato automaticamente da pannelloammonistrazionebundle\n\n* * * * CLEAR CACHE * * * *\n";
86
        } else {
87
            $retmsg = 'Impossibile generare il ruoting automaticamente da pannelloammonistrazionebundle\n';
88
        }
89
90 2
        return $retmsg;
91
    }
92 2
    private function generateFormWiew($bundlename, $entityform, $view)
0 ignored issues
show
Unused Code introduced by
The parameter $bundlename is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

92
    private function generateFormWiew(/** @scrutinizer ignore-unused */ $bundlename, $entityform, $view)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
93
    {
94 2
        $fs = new Filesystem();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 9 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
95 2
        $folderview = $this->apppaths->getSrcPath() . '/../templates/' . $entityform . DIRECTORY_SEPARATOR;
96 2
        $dest = $folderview . $view . '.html.twig';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
97 2
        $fs->mkdir($folderview);
98 2
        file_put_contents($dest, "{% include 'FiCoreBundle:Standard:" . $view . ".html.twig' %}");
99 2
    }
100 2
    private function generateFormsDefaultTableValues($entityform)
101
    {
102
        //Si inserisce il record di default nella tabella permessi
103 2
        $em = $this->getContainer()->get('doctrine')->getManager();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
104 2
        $ruoloAmm = $em->getRepository('FiCoreBundle:Ruoli')->findOneBy(array('is_superadmin' => true)); //SuperAdmin
105
106 2
        $newPermesso = new \Fi\CoreBundle\Entity\Permessi();
107 2
        $newPermesso->setCrud('crud');
108 2
        $newPermesso->setModulo($entityform);
109 2
        $newPermesso->setRuoli($ruoloAmm);
110 2
        $em->persist($newPermesso);
111 2
        $em->flush();
112
113 2
        $tabelle = new \Fi\CoreBundle\Entity\Tabelle();
114 2
        $tabelle->setNometabella($entityform);
115 2
        $em->persist($tabelle);
116 2
        $em->flush();
117 2
    }
118 2
    private function getControllerCode($bundlename, $tabella)
119
    {
120
        $codeTemplate = <<<EOF
121 2
<?php
122
namespace [bundle]\Controller;
123
124
use Fi\CoreBundle\Controller\FiController;
125
use Symfony\Component\HttpFoundation\Request;
126
use Symfony\Component\HttpFoundation\Response;
127
use Fi\CoreBundle\Controller\Griglia;
128
use [bundle]\Entity\[tabella];
129
use [bundle]\Form\[tabella]Type;
130
131
132
/**
133
* [tabella] controller.
134
*
135
*/
136
137
class [tabella]Controller extends FiController {
138
139
}
140
EOF;
141 2
        $codebundle = str_replace('[bundle]', $bundlename, $codeTemplate);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
142 2
        $code = str_replace('[tabella]', $tabella, $codebundle);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 9 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
143
144 2
        return $code;
145
    }
146 2
    private function getRoutingCode($bundlename, $tabella)
147
    {
148
        $codeTemplate = <<<'EOF'
149 2
[tabella]_container:
150
    path:  /
151
    defaults: { _controller: '[bundle]\Controller\[tabella]Controller::indexAction' }
152
153
[tabella]_new:
154
    path:  /new
155
    defaults: { _controller: '[bundle]\Controller\[tabella]Controller::newAction' }
156
157
[tabella]_create:
158
    path:  /create
159
    defaults: { _controller: '[bundle]\Controller\[tabella]Controller::createAction' }
160
    requirements: { methods: post }
161
162
[tabella]_edit:
163
    path:  /{id}/edit
164
    defaults: { _controller: '[bundle]\Controller\[tabella]Controller::editAction' }
165
166
[tabella]_update:
167
    path:  /{id}/update
168
    defaults: { _controller: '[bundle]\Controller\[tabella]Controller::updateAction' }
169
    requirements: { methods: post|put }
170
171
[tabella]_aggiorna:
172
    path:  /aggiorna
173
    defaults: { _controller: '[bundle]\Controller\[tabella]Controller::aggiornaAction' }
174
    requirements: { methods: post|put }
175
176
[tabella]_delete:
177
    path:  /{id}/delete
178
    defaults: { _controller: '[bundle]\Controller\[tabella]Controller::deleteAction' }
179
    requirements: { methods: post|delete }
180
181
[tabella]_deletemultiple:
182
    path:  /delete
183
    defaults: { _controller: '[bundle]\Controller\[tabella]Controller::deleteAction' }
184
    requirements: { methods: post|delete }
185
186
[tabella]_griglia:
187
    path:  /griglia
188
    defaults: { _controller: '[bundle]\Controller\[tabella]Controller::GrigliaAction' }
189
    requirements: { methods: get|post }
190
EOF;
191 2
        $codebundle = str_replace('[bundle]', $bundlename, $codeTemplate);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
192 2
        $code = str_replace('[tabella]', $tabella, $codebundle);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 9 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
193
194 2
        return $code;
195
    }
196
}
197