@@ -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 | } |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | $helper = new QuestionHelper(); |
87 | 87 | $question = new ConfirmationQuestion( |
88 | 88 | sprintf( |
89 | - '<question>"%s" isolator discover that last time '. |
|
90 | - 'environment was not restored properly.'.PHP_EOL |
|
89 | + '<question>"%s" isolator discover that last time ' . |
|
90 | + 'environment was not restored properly.' . PHP_EOL |
|
91 | 91 | .'Do you what to restore the state?(Y/n)</question>', |
92 | 92 | $isolator->getName() |
93 | 93 | ), |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | |
112 | - $this->stopwatch->start($isolator->getTag().'::start'); |
|
112 | + $this->stopwatch->start($isolator->getTag() . '::start'); |
|
113 | 113 | try { |
114 | 114 | $isolator->start($event); |
115 | 115 | } catch (TableNotFoundException $e) { |
116 | 116 | break; |
117 | 117 | } finally { |
118 | - $eventResult = $this->stopwatch->stop($isolator->getTag().'::start'); |
|
118 | + $eventResult = $this->stopwatch->stop($isolator->getTag() . '::start'); |
|
119 | 119 | if ($eventResult->getDuration() >= self::ISOLATOR_THRESHOLD) { |
120 | 120 | $this->output->writeln(sprintf('time: %s ms', $eventResult->getDuration())); |
121 | 121 | } |
@@ -140,13 +140,13 @@ discard block |
||
140 | 140 | continue; |
141 | 141 | } |
142 | 142 | |
143 | - $this->stopwatch->start($isolator->getTag().'::beforeTest'); |
|
143 | + $this->stopwatch->start($isolator->getTag() . '::beforeTest'); |
|
144 | 144 | try { |
145 | 145 | $isolator->beforeTest($event); |
146 | 146 | } catch (TableNotFoundException $e) { |
147 | 147 | break; |
148 | 148 | } finally { |
149 | - $eventResult = $this->stopwatch->stop($isolator->getTag().'::beforeTest'); |
|
149 | + $eventResult = $this->stopwatch->stop($isolator->getTag() . '::beforeTest'); |
|
150 | 150 | if ($eventResult->getDuration() >= self::ISOLATOR_THRESHOLD) { |
151 | 151 | $this->output->writeln(sprintf('time: %s ms', $eventResult->getDuration())); |
152 | 152 | } |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | continue; |
182 | 182 | } |
183 | 183 | |
184 | - $this->stopwatch->start($isolator->getTag().'::afterTest'); |
|
184 | + $this->stopwatch->start($isolator->getTag() . '::afterTest'); |
|
185 | 185 | try { |
186 | 186 | $isolator->afterTest($event); |
187 | 187 | } catch (TableNotFoundException $e) { |
188 | 188 | break; |
189 | 189 | } finally { |
190 | - $eventResult = $this->stopwatch->stop($isolator->getTag().'::afterTest'); |
|
190 | + $eventResult = $this->stopwatch->stop($isolator->getTag() . '::afterTest'); |
|
191 | 191 | if ($eventResult->getDuration() >= self::ISOLATOR_THRESHOLD) { |
192 | 192 | $this->output->writeln(sprintf('time: %s ms', $eventResult->getDuration())); |
193 | 193 | } |
@@ -209,13 +209,13 @@ discard block |
||
209 | 209 | continue; |
210 | 210 | } |
211 | 211 | |
212 | - $this->stopwatch->start($isolator->getTag().'::terminate'); |
|
212 | + $this->stopwatch->start($isolator->getTag() . '::terminate'); |
|
213 | 213 | try { |
214 | 214 | $isolator->terminate($event); |
215 | 215 | } catch (TableNotFoundException $e) { |
216 | 216 | break; |
217 | 217 | } finally { |
218 | - $eventResult = $this->stopwatch->stop($isolator->getTag().'::terminate'); |
|
218 | + $eventResult = $this->stopwatch->stop($isolator->getTag() . '::terminate'); |
|
219 | 219 | if ($eventResult->getDuration() >= self::ISOLATOR_THRESHOLD) { |
220 | 220 | $this->output->writeln(sprintf('time: %s ms', $eventResult->getDuration())); |
221 | 221 | } |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | $container = $kernel->getContainer(); |
51 | 51 | |
52 | 52 | $this->dbHost = $container->getParameter('database_host'); |
53 | - $this->dbPort = $container->getParameter('database_port') ? : 3306; |
|
53 | + $this->dbPort = $container->getParameter('database_port') ?: 3306; |
|
54 | 54 | $this->dbName = $container->getParameter('database_name'); |
55 | 55 | $this->dbUser = $container->getParameter('database_user'); |
56 | 56 | $this->dbPass = $container->getParameter('database_password'); |
57 | - $this->dbDump = sys_get_temp_dir().DIRECTORY_SEPARATOR.$this->dbName.TokenGenerator::generateToken('db'); |
|
58 | - $this->dbTempName = $this->dbName.'_temp'.TokenGenerator::generateToken('db'); |
|
57 | + $this->dbDump = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $this->dbName . TokenGenerator::generateToken('db'); |
|
58 | + $this->dbTempName = $this->dbName . '_temp' . TokenGenerator::generateToken('db'); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** {@inheritdoc} */ |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | protected function renameTempDb() |
209 | 209 | { |
210 | 210 | $this->restoreDbFromDumpProcess = $this->runProcess(sprintf( |
211 | - 'MYSQL_PWD=%s && for table in `mysql -h %s -P %s -u %s -s -N -e "use %s;show tables from %4$s;"`; '. |
|
211 | + 'MYSQL_PWD=%s && for table in `mysql -h %s -P %s -u %s -s -N -e "use %s;show tables from %4$s;"`; ' . |
|
212 | 212 | 'do mysql -h %2$s -u %3$s -s -N -e "use %4$s;rename table %4$s.$table to %5$s.$table;"; done;', |
213 | 213 | $this->dbPass, |
214 | 214 | $this->dbHost, |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | private function isDbExists($dbName) |
274 | 274 | { |
275 | 275 | $process = $this->runProcess(sprintf( |
276 | - 'MYSQL_PWD=%s mysql -e "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA '. |
|
276 | + 'MYSQL_PWD=%s mysql -e "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA ' . |
|
277 | 277 | 'WHERE SCHEMA_NAME = \'%s\'" -h %s -P %s -u %s', |
278 | 278 | $this->dbPass, |
279 | 279 | $dbName, |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | $path = $event->getFeature()->getFile(); |
52 | 52 | |
53 | 53 | $featureFileName = pathinfo($path, PATHINFO_BASENAME); |
54 | - $expectedFileName = $this->canonize($featureTitle).'.feature'; |
|
54 | + $expectedFileName = $this->canonize($featureTitle) . '.feature'; |
|
55 | 55 | |
56 | 56 | if ($expectedFileName != $featureFileName) { |
57 | 57 | $this->rename($path, $expectedFileName); |
58 | 58 | $this->errors[] = sprintf( |
59 | - 'Feature "%s" should be renamed to "%s"'.PHP_EOL. |
|
59 | + 'Feature "%s" should be renamed to "%s"' . PHP_EOL . |
|
60 | 60 | 'Actually it is renamed, so please apply and commit changes', |
61 | 61 | $featureFileName, |
62 | 62 | $expectedFileName |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | private function rename($featurePath, $newFileName) |
119 | 119 | { |
120 | 120 | $dir = pathinfo($featurePath, PATHINFO_DIRNAME); |
121 | - $newFeaturePath = $dir.DIRECTORY_SEPARATOR.$newFileName; |
|
121 | + $newFeaturePath = $dir . DIRECTORY_SEPARATOR . $newFileName; |
|
122 | 122 | |
123 | 123 | if (is_file($newFeaturePath)) { |
124 | 124 | $this->errors[] = sprintf('File "%s" cannot be renamed to "%s"', $featurePath, $newFeaturePath); |
@@ -120,9 +120,9 @@ |
||
120 | 120 | private function addDetails(&$message, BeforeFeatureTested $event, $exception) |
121 | 121 | { |
122 | 122 | $message = sprintf( |
123 | - $message.PHP_EOL. |
|
124 | - ' Suite: %s'.PHP_EOL. |
|
125 | - ' Feature: %s'.PHP_EOL. |
|
123 | + $message . PHP_EOL . |
|
124 | + ' Suite: %s' . PHP_EOL . |
|
125 | + ' Feature: %s' . PHP_EOL . |
|
126 | 126 | ' %s', |
127 | 127 | $event->getSuite()->getName(), |
128 | 128 | $event->getFeature()->getFile(), |