Completed
Push — master ( 181da6...1dd547 )
by Vladimir
04:19
created
src/Command/CheckGeneratorCommand.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
 
170 170
                     $fPath = sprintf('%s%s%s%s%s%s%s%s%s',
171 171
                         $bundle->getPath(),
172
-                       DIRECTORY_SEPARATOR,
172
+                        DIRECTORY_SEPARATOR,
173 173
                         $testPath,
174 174
                         DIRECTORY_SEPARATOR,
175 175
                         'Test',
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
             ->setName('tvi:monitor:generator:check')
34 34
             ->setDescription('Generates check plugin from tvi monitor template')
35 35
             ->addArgument('name', InputArgument::REQUIRED, 'Check name')
36
-            ->addOption('group', 'g',InputOption::VALUE_OPTIONAL, 'Check group')
37
-            ->addOption('integration-test-src', null,InputOption::VALUE_OPTIONAL, 'Path to integration tests src', null)
36
+            ->addOption('group', 'g', InputOption::VALUE_OPTIONAL, 'Check group')
37
+            ->addOption('integration-test-src', null, InputOption::VALUE_OPTIONAL, 'Path to integration tests src', null)
38 38
             ->addOption('no-backup', 'b', InputOption::VALUE_NONE, 'Do not backup existing check files.')
39 39
             ->setHelp(<<<EOT
40 40
 The <info>%command.name%</info> command generates check classes
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         @list($bundle, $checkPath) = (count($r) == 1) ? [null, current($r)] : $r;
93 93
 
94 94
         /* @var $bundle Bundle */
95
-        if(!$bundle) {
95
+        if (!$bundle) {
96 96
             $defaultBundle = 'TviMonitorBundle';
97 97
             $bundle = $this->getApplication()->getKernel()->getBundle('TviMonitorBundle');
98 98
             $output->writeln(sprintf('<info>Use default bundle <comment>%s</comment></info>', $bundle->getNamespace()));
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         }
106 106
 
107 107
         preg_match('#^(.*?)(\w+)$#', $checkPath, $m);
108
-        list($checkNamespace, $checkName) =  [$m[1], $m[2]];
108
+        list($checkNamespace, $checkName) = [$m[1], $m[2]];
109 109
 
110 110
         $checkNamespace = preg_replace('#\\\$#', '', $checkNamespace);
111 111
         $bundleNamespace = $bundle->getNamespace();
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         $CHECK_ALIAS = strtolower($CHECK_ALIAS);
125 125
 
126 126
         $group = $input->getOption('group');
127
-        $CHECK_GROUP = $group ? $group: $CHECK_ALIAS;
127
+        $CHECK_GROUP = $group ? $group : $CHECK_ALIAS;
128 128
 
129 129
         //v($NAMESPACE, $SERVICE_PREFIX, $CHECK_ALIAS, $checkName); exit;
130 130
 
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
 
134 134
         $noBackup = !$input->getOption('no-backup');
135 135
 
136
-        if(is_dir($checkPath)) {
136
+        if (is_dir($checkPath)) {
137 137
 
138
-            if($noBackup && is_dir($checkPath)) {
138
+            if ($noBackup && is_dir($checkPath)) {
139 139
                 $output->writeln(sprintf('<info><error>Check %s exist</error>. Use --no-backup flag to rewrite</info>', $NAMESPACE));
140 140
                 exit(1);
141 141
             } else {
@@ -150,17 +150,17 @@  discard block
 block discarded – undo
150 150
 
151 151
         foreach ($this->tpls as $f) {
152 152
 
153
-            if(in_array($f->getBasename(), ['config.example.yml.twig', 'README.mdpp.twig'])) {
153
+            if (in_array($f->getBasename(), ['config.example.yml.twig', 'README.mdpp.twig'])) {
154 154
                 continue;
155 155
             }
156 156
 
157 157
             /* @var SplFileInfo $f */
158 158
             $fName = $f->getBasename('.twig');
159 159
 
160
-            if($fName == 'Test.php.integration') {
160
+            if ($fName == 'Test.php.integration') {
161 161
 
162 162
                 $testPath = $input->getOption('integration-test-src');
163
-                if(!$testPath) {
163
+                if (!$testPath) {
164 164
                     continue;
165 165
                 } else {
166 166
                     $fName = $f->getBasename('.integration.twig');
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
                         $checkName
180 180
                         );
181 181
 
182
-                    if(is_dir($fPath)) {
183
-                        if($noBackup && is_dir($fPath)) {
182
+                    if (is_dir($fPath)) {
183
+                        if ($noBackup && is_dir($fPath)) {
184 184
                             $output->writeln(sprintf('<info>Tests for <error>check %s exist</error>. Use --no-backup flag to rewrite</info>', $NAMESPACE));
185 185
                             continue;
186 186
                         } else {
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
                         @mkdir($fPath, 0775, true) && !is_dir($fPath);
191 191
                     }
192 192
                 }
193
-                $TEST_NAMESPACE = sprintf('%s\%s\%s\%s', $bundleNamespace,'Test', $checkNamespace, $checkName);
193
+                $TEST_NAMESPACE = sprintf('%s\%s\%s\%s', $bundleNamespace, 'Test', $checkNamespace, $checkName);
194 194
 
195 195
                 $tplData = [
196 196
                     'NAMESPACE'      => $TEST_NAMESPACE,
Please login to merge, or discard this patch.