Passed
Push — master ( f5f798...b56d23 )
by Vladimir
04:20
created
src/Check/php/StreamWrapperExists/Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 {
22 22
     public function testIntegration()
23 23
     {
24
-        $this->iterateConfTest(__DIR__ . '/config.example.yml');
24
+        $this->iterateConfTest(__DIR__.'/config.example.yml');
25 25
     }
26 26
 
27 27
     public function testCheck()
Please login to merge, or discard this patch.
src/Check/memcache/Memcache/Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 {
22 22
     public function testIntegration()
23 23
     {
24
-        $this->iterateConfTest(__DIR__ . '/config.example.yml');
24
+        $this->iterateConfTest(__DIR__.'/config.example.yml');
25 25
     }
26 26
 
27 27
     public function testCheck()
Please login to merge, or discard this patch.
src/Check/memcache/Memcached/Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 {
22 22
     public function testIntegration()
23 23
     {
24
-        $this->iterateConfTest(__DIR__ . '/config.example.yml');
24
+        $this->iterateConfTest(__DIR__.'/config.example.yml');
25 25
     }
26 26
 
27 27
     public function testCheck()
Please login to merge, or discard this patch.
src/Check/db/PDOCheck/Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 {
22 22
     public function testIntegration()
23 23
     {
24
-        $this->iterateConfTest(__DIR__ . '/config.example.yml');
24
+        $this->iterateConfTest(__DIR__.'/config.example.yml');
25 25
     }
26 26
 
27 27
     public function testCheck()
Please login to merge, or discard this patch.
src/Check/redis/Redis/Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 {
22 22
     public function testIntegration()
23 23
     {
24
-        $this->iterateConfTest(__DIR__ . '/config.example.yml');
24
+        $this->iterateConfTest(__DIR__.'/config.example.yml');
25 25
     }
26 26
 
27 27
     public function testCheck()
Please login to merge, or discard this patch.
src/Check/mongo/Mongo/Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 {
22 22
     public function testIntegration()
23 23
     {
24
-        $this->iterateConfTest(__DIR__ . '/config.example.yml');
24
+        $this->iterateConfTest(__DIR__.'/config.example.yml');
25 25
     }
26 26
 
27 27
     public function testCheck()
Please login to merge, or discard this patch.
src/Check/http/GuzzleHttpService/Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 {
22 22
     public function testIntegration()
23 23
     {
24
-        $this->iterateConfTest(__DIR__ . '/config.example.yml');
24
+        $this->iterateConfTest(__DIR__.'/config.example.yml');
25 25
     }
26 26
 
27 27
     public function testCheck()
Please login to merge, or discard this patch.
src/Check/http/HttpService/Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 {
22 22
     public function testIntegration()
23 23
     {
24
-        $this->iterateConfTest(__DIR__ . '/config.example.yml');
24
+        $this->iterateConfTest(__DIR__.'/config.example.yml');
25 25
     }
26 26
 
27 27
     public function testCheck()
Please login to merge, or discard this patch.
src/Command/CheckGeneratorCommand.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             ->setName('tvi:monitor:generator:check')
55 55
             ->setDescription('Generates check plugin from tvi monitor template')
56 56
             ->addArgument('checker', InputArgument::REQUIRED, 'Check name')
57
-            ->addOption('group', 'g',InputOption::VALUE_OPTIONAL, 'Check group')
57
+            ->addOption('group', 'g', InputOption::VALUE_OPTIONAL, 'Check group')
58 58
             ->addOption('no-backup', 'b', InputOption::VALUE_NONE, 'Do not backup existing check files.')
59 59
             ->setHelp(<<<EOT
60 60
 The <info>%command.name%</info> command generates check classes
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         @list($bundleName, $checkPath) = (count($r) == 1) ? [null, current($r)] : $r;
107 107
 
108 108
         /* @var $bundle Bundle */
109
-        if(!$bundleName) {
109
+        if (!$bundleName) {
110 110
             $defaultBundle = 'TviMonitorBundle';
111 111
             $bundle = $this->getApplication()->getKernel()->getBundle($defaultBundle);
112 112
             $output->writeln(sprintf('<info>Use default bundle <comment>%s</comment></info>', $bundle->getNamespace()));
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         }
121 121
 
122 122
         preg_match('#^(.*?)(\w+)$#', $checkPath, $m);
123
-        list($checkNamespace, $checkName) =  [$m[1], $m[2]];
123
+        list($checkNamespace, $checkName) = [$m[1], $m[2]];
124 124
 
125 125
         $checkNamespace = preg_replace('#\\\$#', '', $checkNamespace);
126 126
         $bundleNamespace = $bundle->getNamespace();
@@ -144,14 +144,14 @@  discard block
 block discarded – undo
144 144
 
145 145
         //CHECK_GROUP
146 146
         $group = $input->getOption('group');
147
-        $CHECK_GROUP = $group ? $group: $CHECK_ALIAS;
147
+        $CHECK_GROUP = $group ? $group : $CHECK_ALIAS;
148 148
 
149 149
         $checkPath = sprintf('%s%s%s', $bundle->getPath(), DIRECTORY_SEPARATOR, $checkPath);
150 150
         $checkPath = str_replace('\\', DIRECTORY_SEPARATOR, $checkPath);
151 151
 
152
-        if(is_dir($checkPath)) {
152
+        if (is_dir($checkPath)) {
153 153
 
154
-            if($noBackup && is_dir($checkPath)) {
154
+            if ($noBackup && is_dir($checkPath)) {
155 155
                 $output->writeln(sprintf('<info><error>Check %s exist</error>. Use --no-backup flag to rewrite</info>', $NAMESPACE));
156 156
                 exit(1);
157 157
             } else {
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
         foreach ($this->tpls as $f) {
165 165
 
166
-            if(in_array($f->getBasename(), ['config.example.yml.twig', 'README.mdpp.twig'])) {
166
+            if (in_array($f->getBasename(), ['config.example.yml.twig', 'README.mdpp.twig'])) {
167 167
                 continue;
168 168
             }
169 169
 
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 
184 184
             file_put_contents($path, $res);
185 185
 
186
-            $this->createFile($checkPath,'config.example.yml.twig','config.example.yml', $tplData);
187
-            $this->createFile($checkPath,'README.mdpp.twig','README.mdpp', $tplData);
186
+            $this->createFile($checkPath, 'config.example.yml.twig', 'config.example.yml', $tplData);
187
+            $this->createFile($checkPath, 'README.mdpp.twig', 'README.mdpp', $tplData);
188 188
         }
189 189
     }
190 190
 
@@ -200,13 +200,13 @@  discard block
 block discarded – undo
200 200
      */
201 201
     private function createFile(string $basePath, string $from, string $to, array $tplData)
202 202
     {
203
-        $r = array_filter($this->tpls, function (SplFileInfo $f) use($from) {
203
+        $r = array_filter($this->tpls, function(SplFileInfo $f) use($from) {
204 204
             return $f->getBasename() == $from;
205 205
         });
206 206
 
207 207
         /* @var  SplFileInfo $f */
208 208
         $f = current($r);
209
-        if($f) {
209
+        if ($f) {
210 210
             $res = $this->twig->render($f->getRelativePathname(), $tplData);
211 211
             $savePath = sprintf('%s%s%s', $basePath, DIRECTORY_SEPARATOR, $to);
212 212
             file_put_contents($savePath, $res);
Please login to merge, or discard this patch.