@@ -45,8 +45,8 @@ |
||
| 45 | 45 | ->isRequired() |
| 46 | 46 | ->beforeNormalization() |
| 47 | 47 | ->ifString() |
| 48 | - ->then(function ($value) { |
|
| 49 | - if(is_string($value)) { |
|
| 48 | + ->then(function($value) { |
|
| 49 | + if (is_string($value)) { |
|
| 50 | 50 | $value = [$value]; |
| 51 | 51 | } |
| 52 | 52 | return $value; |
@@ -45,8 +45,8 @@ |
||
| 45 | 45 | ->isRequired() |
| 46 | 46 | ->beforeNormalization() |
| 47 | 47 | ->ifString() |
| 48 | - ->then(function ($value) { |
|
| 49 | - if(is_string($value)) { |
|
| 48 | + ->then(function($value) { |
|
| 49 | + if (is_string($value)) { |
|
| 50 | 50 | $value = [$value]; |
| 51 | 51 | } |
| 52 | 52 | return $value; |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | ->children() |
| 21 | 21 | ->arrayNode('check') |
| 22 | 22 | ->beforeNormalization() |
| 23 | - ->always(function ($value) { |
|
| 24 | - if(isset($value['extensionName']) && !is_array($value['extensionName'])) { |
|
| 23 | + ->always(function($value) { |
|
| 24 | + if (isset($value['extensionName']) && !is_array($value['extensionName'])) { |
|
| 25 | 25 | $value['extensionName'] = [$value['extensionName']]; |
| 26 | 26 | } |
| 27 | 27 | return $value; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $this |
| 45 | 45 | ->setName('tvi:monitor:check:info') |
| 46 | 46 | ->setDescription('Info Health Checkers') |
| 47 | - ->addOption('group', 'g',InputOption::VALUE_OPTIONAL, 'Check group') |
|
| 47 | + ->addOption('group', 'g', InputOption::VALUE_OPTIONAL, 'Check group') |
|
| 48 | 48 | ; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $checkMetadatas = $this->manager->getCheckMetadatas($group); |
| 79 | 79 | |
| 80 | 80 | if (0 === count($checkMetadatas)) { |
| 81 | - if(empty($group)) { |
|
| 81 | + if (empty($group)) { |
|
| 82 | 82 | $output->writeln(sprintf('<error>No checks configured.</error>')); |
| 83 | 83 | } else { |
| 84 | 84 | $output->writeln(sprintf('<error>No checks configured for group %s.</error>', $group)); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | foreach ($checkMetadatas as $checkMetadata) { |
| 90 | 90 | |
| 91 | 91 | $currentGroup = $checkMetadata->getGroup(); |
| 92 | - if(empty($group) && $showGroup != $currentGroup) { |
|
| 92 | + if (empty($group) && $showGroup != $currentGroup) { |
|
| 93 | 93 | $output->writeln(sprintf('<fg=yellow;options=bold>%s</>', $currentGroup)); |
| 94 | 94 | $showGroup = $currentGroup; |
| 95 | 95 | } |
@@ -21,7 +21,7 @@ |
||
| 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() |
@@ -54,7 +54,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -21,7 +21,7 @@ |
||
| 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() |
@@ -21,7 +21,7 @@ |
||
| 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() |
@@ -21,7 +21,7 @@ |
||
| 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() |