@@ -22,16 +22,16 @@ discard block |
||
| 22 | 22 | 'type' => null, |
| 23 | 23 | 'settings' => [ |
| 24 | 24 | 'extra_key' => 'extra_value', |
| 25 | - 'paths' => array_map(function ($n) { |
|
| 26 | - return '/tmp/'.$n; |
|
| 25 | + 'paths' => array_map(function($n) { |
|
| 26 | + return '/tmp/' . $n; |
|
| 27 | 27 | }, range(1, 3)) |
| 28 | 28 | ], |
| 29 | 29 | ], |
| 30 | 30 | 'AcmeSuite5' => [ |
| 31 | 31 | 'type' => null, |
| 32 | 32 | 'settings' => [ |
| 33 | - 'paths' => array_map(function ($n) { |
|
| 34 | - return '/tmp/'.$n; |
|
| 33 | + 'paths' => array_map(function($n) { |
|
| 34 | + return '/tmp/' . $n; |
|
| 35 | 35 | }, range(1, 5)) |
| 36 | 36 | ], |
| 37 | 37 | ], |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $this->assertArrayHasKey($setName, $expectedSets, sprintf('"%s" is not expected set name', $setName)); |
| 63 | 63 | $this->assertSame( |
| 64 | 64 | $expectedSets[$setName], |
| 65 | - array_map(function (Suite $configuration) { |
|
| 65 | + array_map(function(Suite $configuration) { |
|
| 66 | 66 | return $configuration->getName(); |
| 67 | 67 | }, $configs) |
| 68 | 68 | ); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | [ |
| 76 | 76 | 'divider' => 10, |
| 77 | 77 | 'expectedSets' => [ |
| 78 | - SuiteConfigurationRegistry::PREFIX_SUITE_SET.'_0' => [ |
|
| 78 | + SuiteConfigurationRegistry::PREFIX_SUITE_SET . '_0' => [ |
|
| 79 | 79 | 'AcmeSuite3_0', |
| 80 | 80 | 'AcmeSuite3_1', |
| 81 | 81 | 'AcmeSuite3_2', |
@@ -90,13 +90,13 @@ discard block |
||
| 90 | 90 | [ |
| 91 | 91 | 'divider' => 5, |
| 92 | 92 | 'expectedSets' => [ |
| 93 | - SuiteConfigurationRegistry::PREFIX_SUITE_SET.'_0' => [ |
|
| 93 | + SuiteConfigurationRegistry::PREFIX_SUITE_SET . '_0' => [ |
|
| 94 | 94 | 'AcmeSuite5_2', |
| 95 | 95 | 'AcmeSuite5_3', |
| 96 | 96 | 'AcmeSuite5_4', |
| 97 | 97 | 'AcmeSuite3_0', |
| 98 | 98 | ], |
| 99 | - SuiteConfigurationRegistry::PREFIX_SUITE_SET.'_1' => [ |
|
| 99 | + SuiteConfigurationRegistry::PREFIX_SUITE_SET . '_1' => [ |
|
| 100 | 100 | 'AcmeSuite3_1', |
| 101 | 101 | 'AcmeSuite3_2', |
| 102 | 102 | 'AcmeSuite5_0', |
@@ -107,17 +107,17 @@ discard block |
||
| 107 | 107 | [ |
| 108 | 108 | 'divider' => 3, |
| 109 | 109 | 'expectedSets' => [ |
| 110 | - SuiteConfigurationRegistry::PREFIX_SUITE_SET.'_0' => [ |
|
| 110 | + SuiteConfigurationRegistry::PREFIX_SUITE_SET . '_0' => [ |
|
| 111 | 111 | 'AcmeSuite3_0', |
| 112 | 112 | 'AcmeSuite3_1', |
| 113 | 113 | 'AcmeSuite3_2', |
| 114 | 114 | ], |
| 115 | - SuiteConfigurationRegistry::PREFIX_SUITE_SET.'_1' => [ |
|
| 115 | + SuiteConfigurationRegistry::PREFIX_SUITE_SET . '_1' => [ |
|
| 116 | 116 | 'AcmeSuite5_3', |
| 117 | 117 | 'AcmeSuite5_4', |
| 118 | 118 | 'AcmeSuite5_0', |
| 119 | 119 | ], |
| 120 | - SuiteConfigurationRegistry::PREFIX_SUITE_SET.'_2' => [ |
|
| 120 | + SuiteConfigurationRegistry::PREFIX_SUITE_SET . '_2' => [ |
|
| 121 | 121 | 'AcmeSuite5_1', |
| 122 | 122 | 'AcmeSuite5_2', |
| 123 | 123 | ], |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | $this->assertInternalType( |
| 197 | 197 | 'array', |
| 198 | - $suiteConfigRegistry->getSet(SuiteConfigurationRegistry::PREFIX_SUITE_SET.'_0') |
|
| 198 | + $suiteConfigRegistry->getSet(SuiteConfigurationRegistry::PREFIX_SUITE_SET . '_0') |
|
| 199 | 199 | ); |
| 200 | 200 | } |
| 201 | 201 | |
@@ -32,35 +32,35 @@ |
||
| 32 | 32 | 'array' => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], |
| 33 | 33 | 'Suite divider' => 3, |
| 34 | 34 | 'Expected result' => [ |
| 35 | - self::BASE_NAME.'_0' => [1, 2, 3], |
|
| 36 | - self::BASE_NAME.'_1' => [4, 5, 6], |
|
| 37 | - self::BASE_NAME.'_2' => [10, 7], |
|
| 38 | - self::BASE_NAME.'_3' => [8, 9] |
|
| 35 | + self::BASE_NAME . '_0' => [1, 2, 3], |
|
| 36 | + self::BASE_NAME . '_1' => [4, 5, 6], |
|
| 37 | + self::BASE_NAME . '_2' => [10, 7], |
|
| 38 | + self::BASE_NAME . '_3' => [8, 9] |
|
| 39 | 39 | ], |
| 40 | 40 | ], |
| 41 | 41 | [ |
| 42 | 42 | 'array' => [1, 2, 3, 4], |
| 43 | 43 | 'Suite divider' => 3, |
| 44 | 44 | 'Expected result' => [ |
| 45 | - self::BASE_NAME.'_0' => [4, 1], |
|
| 46 | - self::BASE_NAME.'_1' => [2, 3], |
|
| 45 | + self::BASE_NAME . '_0' => [4, 1], |
|
| 46 | + self::BASE_NAME . '_1' => [2, 3], |
|
| 47 | 47 | ], |
| 48 | 48 | ], |
| 49 | 49 | [ |
| 50 | 50 | 'array' => [1, 2, 3, 4], |
| 51 | 51 | 'Suite divider' => 1, |
| 52 | 52 | 'Expected result' => [ |
| 53 | - self::BASE_NAME.'_0' => [1], |
|
| 54 | - self::BASE_NAME.'_1' => [2], |
|
| 55 | - self::BASE_NAME.'_2' => [3], |
|
| 56 | - self::BASE_NAME.'_3' => [4], |
|
| 53 | + self::BASE_NAME . '_0' => [1], |
|
| 54 | + self::BASE_NAME . '_1' => [2], |
|
| 55 | + self::BASE_NAME . '_2' => [3], |
|
| 56 | + self::BASE_NAME . '_3' => [4], |
|
| 57 | 57 | ] |
| 58 | 58 | ], |
| 59 | 59 | [ |
| 60 | 60 | 'array' => [1, 2, 3, 4, 5], |
| 61 | 61 | 'Suite divider' => 7, |
| 62 | 62 | 'Expected result' => [ |
| 63 | - self::BASE_NAME.'_0' => [1, 2, 3, 4, 5] |
|
| 63 | + self::BASE_NAME . '_0' => [1, 2, 3, 4, 5] |
|
| 64 | 64 | ] |
| 65 | 65 | ], |
| 66 | 66 | ]; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function prepareProcess() |
| 44 | 44 | { |
| 45 | - $this->testAppPath = realpath(__DIR__.'/../../TestApp'); |
|
| 45 | + $this->testAppPath = realpath(__DIR__ . '/../../TestApp'); |
|
| 46 | 46 | $phpFinder = new PhpExecutableFinder(); |
| 47 | 47 | if (false === $php = $phpFinder->find()) { |
| 48 | 48 | throw new \RuntimeException('Unable to find the PHP executable.'); |
@@ -54,13 +54,13 @@ discard block |
||
| 54 | 54 | /** @BeforeScenario */ |
| 55 | 55 | public function prepareBehatYaml() |
| 56 | 56 | { |
| 57 | - $behatYaml = $this->testAppPath.'/behat.yml'; |
|
| 57 | + $behatYaml = $this->testAppPath . '/behat.yml'; |
|
| 58 | 58 | |
| 59 | 59 | if (file_exists($behatYaml)) { |
| 60 | 60 | unlink($behatYaml); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - copy($this->testAppPath.'/behat.yml.dist', $behatYaml); |
|
| 63 | + copy($this->testAppPath . '/behat.yml.dist', $behatYaml); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | escapeshellarg(BEHAT_BIN_PATH), |
| 83 | 83 | $argumentsString, |
| 84 | 84 | strtr('--format-settings=\'{"timer": false}\'', ['\'' => '"', '"' => '\"']), |
| 85 | - $this->testAppPath.'/behat.yml' |
|
| 85 | + $this->testAppPath . '/behat.yml' |
|
| 86 | 86 | ) |
| 87 | 87 | ); |
| 88 | 88 | $this->process->start(); |
@@ -94,12 +94,12 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function enabledExtensionInBehatYml(PyStringNode $extensionConfig) |
| 96 | 96 | { |
| 97 | - $config = Yaml::parse(file_get_contents($this->testAppPath.'/behat.yml')); |
|
| 97 | + $config = Yaml::parse(file_get_contents($this->testAppPath . '/behat.yml')); |
|
| 98 | 98 | $extensionConfig = Yaml::parse($extensionConfig->getRaw()); |
| 99 | 99 | $config['default']['extensions'] = $extensionConfig; |
| 100 | 100 | $this->dbConfig = array_shift($extensionConfig)['connection']; |
| 101 | 101 | |
| 102 | - file_put_contents($this->testAppPath.'/behat.yml', Yaml::dump($config, 6)); |
|
| 102 | + file_put_contents($this->testAppPath . '/behat.yml', Yaml::dump($config, 6)); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -107,11 +107,11 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function enabledSuitesInBehatYml(PyStringNode $suitesConfig) |
| 109 | 109 | { |
| 110 | - $config = Yaml::parse(file_get_contents($this->testAppPath.'/behat.yml')); |
|
| 110 | + $config = Yaml::parse(file_get_contents($this->testAppPath . '/behat.yml')); |
|
| 111 | 111 | $suitesConfig = Yaml::parse($suitesConfig->getRaw()); |
| 112 | 112 | $config['default']['suites'] = $suitesConfig; |
| 113 | 113 | |
| 114 | - file_put_contents($this->testAppPath.'/behat.yml', Yaml::dump($config, 6)); |
|
| 114 | + file_put_contents($this->testAppPath . '/behat.yml', Yaml::dump($config, 6)); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function sqliteDatabaseExists($dbname) |
| 208 | 208 | { |
| 209 | - $dbFile = $this->testAppPath.'/'.$dbname; |
|
| 209 | + $dbFile = $this->testAppPath . '/' . $dbname; |
|
| 210 | 210 | |
| 211 | 211 | if (file_exists($dbFile)) { |
| 212 | 212 | unlink($dbFile); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | throw new RuntimeException('No db name in configuration'); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - $dbName = $this->dbConfig['dbname']; |
|
| 228 | + $dbName = $this->dbConfig['dbname']; |
|
| 229 | 229 | $dbConfig = $this->dbConfig; |
| 230 | 230 | $dbConfig['dbname'] = null; |
| 231 | 231 | |
@@ -290,21 +290,21 @@ discard block |
||
| 290 | 290 | if ('/' !== DIRECTORY_SEPARATOR) { |
| 291 | 291 | $text = preg_replace_callback( |
| 292 | 292 | '/ features\/[^\n ]+/', |
| 293 | - function ($matches) { |
|
| 293 | + function($matches) { |
|
| 294 | 294 | return str_replace('/', DIRECTORY_SEPARATOR, $matches[0]); |
| 295 | 295 | }, |
| 296 | 296 | $text |
| 297 | 297 | ); |
| 298 | 298 | $text = preg_replace_callback( |
| 299 | 299 | '/\<span class\="path"\>features\/[^\<]+/', |
| 300 | - function ($matches) { |
|
| 300 | + function($matches) { |
|
| 301 | 301 | return str_replace('/', DIRECTORY_SEPARATOR, $matches[0]); |
| 302 | 302 | }, |
| 303 | 303 | $text |
| 304 | 304 | ); |
| 305 | 305 | $text = preg_replace_callback( |
| 306 | 306 | '/\+[fd] [^ ]+/', |
| 307 | - function ($matches) { |
|
| 307 | + function($matches) { |
|
| 308 | 308 | return str_replace('/', DIRECTORY_SEPARATOR, $matches[0]); |
| 309 | 309 | }, |
| 310 | 310 | $text |
@@ -333,10 +333,10 @@ discard block |
||
| 333 | 333 | */ |
| 334 | 334 | public function iReconfigureStatisticExtension(PyStringNode $extensionConfig) |
| 335 | 335 | { |
| 336 | - $config = Yaml::parse(file_get_contents($this->testAppPath.'/behat.yml')); |
|
| 336 | + $config = Yaml::parse(file_get_contents($this->testAppPath . '/behat.yml')); |
|
| 337 | 337 | $extensionConfig = Yaml::parse($extensionConfig->getRaw()); |
| 338 | 338 | $config['default']['extensions'][BehatStatisticExtension::class] = $extensionConfig; |
| 339 | 339 | |
| 340 | - file_put_contents($this->testAppPath.'/behat.yml', Yaml::dump($config, 6)); |
|
| 340 | + file_put_contents($this->testAppPath . '/behat.yml', Yaml::dump($config, 6)); |
|
| 341 | 341 | } |
| 342 | 342 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | $index = 0; |
| 45 | 45 | |
| 46 | 46 | while (count($suiteDuration)) { |
| 47 | - $setName = $baseName.'_'.$index; |
|
| 47 | + $setName = $baseName . '_' . $index; |
|
| 48 | 48 | if (!isset($generatedSets[$setName])) { |
| 49 | 49 | $setDuration[$setName] = reset($suiteDuration); |
| 50 | 50 | $generatedSets[$setName][] = $array[key($suiteDuration)]; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | $chunks = $this->getChunks($array, $divider); |
| 41 | 41 | foreach ($chunks as $index => $chunk) { |
| 42 | - $generatedSuiteName = $baseName.'_'.$index; |
|
| 42 | + $generatedSuiteName = $baseName . '_' . $index; |
|
| 43 | 43 | $generatedSuites[$generatedSuiteName] = $chunk; |
| 44 | 44 | } |
| 45 | 45 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $count = count($array); |
| 52 | 52 | $chunks = array_chunk($array, $divider); |
| 53 | 53 | |
| 54 | - if (0 === $count%$divider) { |
|
| 54 | + if (0 === $count % $divider) { |
|
| 55 | 55 | return $chunks; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | $tail = array_merge(array_pop($chunks), array_pop($chunks)); |
| 63 | - $tailChunks = array_chunk($tail, round(count($tail)/2)); |
|
| 63 | + $tailChunks = array_chunk($tail, round(count($tail) / 2)); |
|
| 64 | 64 | |
| 65 | 65 | array_push($chunks, $tailChunks[0], $tailChunks[1]); |
| 66 | 66 | |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | |
| 119 | 119 | $sets = []; |
| 120 | 120 | foreach ($this->suiteConfigRegistry->getSets() as $setName => $suites) { |
| 121 | - $sets[$setName] = array_map(function (Suite $suite) { |
|
| 121 | + $sets[$setName] = array_map(function(Suite $suite) { |
|
| 122 | 122 | return $suite->getName(); |
| 123 | 123 | }, $suites); |
| 124 | 124 | } |
@@ -111,12 +111,12 @@ |
||
| 111 | 111 | public static function fromArray(array $data) |
| 112 | 112 | { |
| 113 | 113 | $model = new self(); |
| 114 | - $model->id = isset($data['id']) ? $data['id'] : null; |
|
| 115 | - $model->path = isset($data['path']) ? $data['path'] : null; |
|
| 116 | - $model->time = isset($data['time']) ? $data['time'] : null; |
|
| 114 | + $model->id = isset($data['id']) ? $data['id'] : null; |
|
| 115 | + $model->path = isset($data['path']) ? $data['path'] : null; |
|
| 116 | + $model->time = isset($data['time']) ? $data['time'] : null; |
|
| 117 | 117 | $model->gitBranch = isset($data['git_branch']) ? $data['git_branch'] : null; |
| 118 | 118 | $model->gitTarget = isset($data['git_target']) ? $data['git_target'] : null; |
| 119 | - $model->buildId = isset($data['build_id']) ? $data['build_id'] : null; |
|
| 119 | + $model->buildId = isset($data['build_id']) ? $data['build_id'] : null; |
|
| 120 | 120 | |
| 121 | 121 | return $model; |
| 122 | 122 | } |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | */ |
| 100 | 100 | private function getEnvVars(array $criteria) |
| 101 | 101 | { |
| 102 | - $vars = array_map(function ($env) { |
|
| 102 | + $vars = array_map(function($env) { |
|
| 103 | 103 | return getenv($env) ?: null; |
| 104 | 104 | }, $criteria); |
| 105 | 105 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $sndParent = $label->getParent()->getParent(); |
| 206 | 206 | |
| 207 | 207 | if ($sndParent->hasClass('control-group-collection')) { |
| 208 | - $elementName = Inflector::singularize(trim($label->getText())).'Collection'; |
|
| 208 | + $elementName = Inflector::singularize(trim($label->getText())) . 'Collection'; |
|
| 209 | 209 | $elementName = $this->elementFactory->hasElement($elementName) ? $elementName : 'CollectionField'; |
| 210 | 210 | |
| 211 | 211 | return $this->elementFactory->wrapElement($elementName, $sndParent); |
@@ -219,9 +219,9 @@ discard block |
||
| 219 | 219 | return $sndParent->find('css', 'input[type=checkbox]'); |
| 220 | 220 | } elseif ($sndParent->hasClass('control-group-choice')) { |
| 221 | 221 | return $this->elementFactory->wrapElement('GroupChoiceField', $sndParent->find('css', '.controls')); |
| 222 | - } elseif ($field = $sndParent->find('css', '#'.$label->getAttribute('for'))) { |
|
| 222 | + } elseif ($field = $sndParent->find('css', '#' . $label->getAttribute('for'))) { |
|
| 223 | 223 | return $field; |
| 224 | - } elseif ($field = $this->getPage()->find('css', '#'.$label->getAttribute('for'))) { |
|
| 224 | + } elseif ($field = $this->getPage()->find('css', '#' . $label->getAttribute('for'))) { |
|
| 225 | 225 | return $field; |
| 226 | 226 | } else { |
| 227 | 227 | self::fail(sprintf('Find label "%s", but can\'t determine field type', $locator)); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $value = new \DateTime($matches['value']); |
| 283 | 283 | } |
| 284 | 284 | if ('Date' === $matches['function']) { |
| 285 | - $parsed = new \DateTime($matches['value']); |
|
| 285 | + $parsed = new \DateTime($matches['value']); |
|
| 286 | 286 | $value = str_replace($matches[0], $parsed->format('M j, Y'), $value); |
| 287 | 287 | } |
| 288 | 288 | } |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | |
| 382 | 382 | self::assertNotEmpty($errorSpans, "Field $fieldName has no validation errors"); |
| 383 | 383 | |
| 384 | - return array_map(function (NodeElement $error) { |
|
| 384 | + return array_map(function(NodeElement $error) { |
|
| 385 | 385 | return $error->getText(); |
| 386 | 386 | }, $errorSpans); |
| 387 | 387 | } |