@@ -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 |
@@ -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, |
@@ -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(), |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | $this->mink = $mink; |
45 | 45 | $this->logDir = $logDir; |
46 | - $this->logFile = $this->logDir.DIRECTORY_SEPARATOR.'behat_'.LogType::BROWSER.'.log'; |
|
46 | + $this->logFile = $this->logDir . DIRECTORY_SEPARATOR . 'behat_' . LogType::BROWSER . '.log'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | foreach ($content as $item) { |
115 | 115 | $time = isset($item['timestamp']) |
116 | - ? '@'.round($item['timestamp']/1000) |
|
116 | + ? '@' . round($item['timestamp'] / 1000) |
|
117 | 117 | : 'now'; |
118 | 118 | $dateTime = new \DateTime($time); |
119 | 119 | $level = isset($item['level']) |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $request = array( |
33 | 33 | "user" => array( |
34 | 34 | "username" => 'user_' . mt_rand(), |
35 | - "email" => 'test_' . mt_rand() . '@test.com', |
|
35 | + "email" => 'test_' . mt_rand() . '@test.com', |
|
36 | 36 | "enabled" => '1', |
37 | 37 | "plainPassword" => '1231231q', |
38 | 38 | "firstName" => "firstName", |