@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | continue; |
119 | 119 | } |
120 | 120 | |
121 | - $query .= "\n" . rtrim($sqlLine); |
|
121 | + $query .= "\n".rtrim($sqlLine); |
|
122 | 122 | |
123 | 123 | if (substr($query, -1 * $delimiterLength, $delimiterLength) == $delimiter) { |
124 | 124 | $this->sqlQuery(substr($query, 0, -1 * $delimiterLength)); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $params = []; |
178 | 178 | foreach ($criteria as $k => $v) { |
179 | 179 | if ($v === null) { |
180 | - $params[] = $this->getQuotedName($k) . " IS NULL "; |
|
180 | + $params[] = $this->getQuotedName($k)." IS NULL "; |
|
181 | 181 | unset($criteria[$k]); |
182 | 182 | continue; |
183 | 183 | } |
@@ -192,16 +192,16 @@ discard block |
||
192 | 192 | $hasOperand = true; |
193 | 193 | $k = str_ireplace(" $operand", '', $k); |
194 | 194 | $operand = strtoupper($operand); |
195 | - $params[] = $this->getQuotedName($k) . " $operand ? "; |
|
195 | + $params[] = $this->getQuotedName($k)." $operand ? "; |
|
196 | 196 | break; |
197 | 197 | } |
198 | 198 | |
199 | 199 | if (!$hasOperand) { |
200 | - $params[] = $this->getQuotedName($k) . " = ? "; |
|
200 | + $params[] = $this->getQuotedName($k)." = ? "; |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
204 | - return 'WHERE ' . implode('AND ', $params); |
|
204 | + return 'WHERE '.implode('AND ', $params); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function deleteQuery($table, $id, $primaryKey = 'id') |
211 | 211 | { |
212 | - $query = 'DELETE FROM ' . $this->getQuotedName($table) . ' WHERE ' . $this->getQuotedName($primaryKey) . ' = ?'; |
|
212 | + $query = 'DELETE FROM '.$this->getQuotedName($table).' WHERE '.$this->getQuotedName($primaryKey).' = ?'; |
|
213 | 213 | $this->executeQuery($query, [$id]); |
214 | 214 | } |
215 | 215 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | { |
218 | 218 | $where = $this->generateWhereClause($criteria); |
219 | 219 | |
220 | - $query = 'DELETE FROM ' . $this->getQuotedName($table) . ' ' . $where; |
|
220 | + $query = 'DELETE FROM '.$this->getQuotedName($table).' '.$where; |
|
221 | 221 | $this->executeQuery($query, array_values($criteria)); |
222 | 222 | } |
223 | 223 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | public function getQuotedName($name) |
230 | 230 | { |
231 | - return '"' . str_replace('.', '"."', $name) . '"'; |
|
231 | + return '"'.str_replace('.', '"."', $name).'"'; |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | protected function sqlLine($sql) |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | } catch (\PDOException $e) { |
249 | 249 | throw new ModuleException( |
250 | 250 | 'Codeception\Module\Db', |
251 | - $e->getMessage() . "\nSQL query being executed: " . $query |
|
251 | + $e->getMessage()."\nSQL query being executed: ".$query |
|
252 | 252 | ); |
253 | 253 | } |
254 | 254 | } |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | |
329 | 329 | $set = []; |
330 | 330 | foreach ($data as $column => $value) { |
331 | - $set[] = $this->getQuotedName($column) . " = ?"; |
|
331 | + $set[] = $this->getQuotedName($column)." = ?"; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | $where = $this->generateWhereClause($criteria); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $this->searchPath = $match[0]; |
49 | 49 | } |
50 | 50 | |
51 | - $query .= "\n" . rtrim($sqlLine); |
|
51 | + $query .= "\n".rtrim($sqlLine); |
|
52 | 52 | |
53 | 53 | if (!$dollarsOpen && substr($query, -1 * $delimiterLength, $delimiterLength) == $delimiter) { |
54 | 54 | $this->sqlQuery(substr($query, 0, -1 * $delimiterLength)); |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | |
76 | 76 | if ($sql == '\.') { |
77 | 77 | $this->putline = false; |
78 | - pg_put_line($this->connection, $sql . "\n"); |
|
78 | + pg_put_line($this->connection, $sql."\n"); |
|
79 | 79 | pg_end_copy($this->connection); |
80 | 80 | pg_close($this->connection); |
81 | 81 | } else { |
82 | - pg_put_line($this->connection, $sql . "\n"); |
|
82 | + pg_put_line($this->connection, $sql."\n"); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | return true; |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | ); |
102 | 102 | } |
103 | 103 | $constring = str_replace(';', ' ', substr($this->dsn, 6)); |
104 | - $constring .= ' user=' . $this->user; |
|
105 | - $constring .= ' password=' . $this->password; |
|
104 | + $constring .= ' user='.$this->user; |
|
105 | + $constring .= ' password='.$this->password; |
|
106 | 106 | $this->connection = pg_connect($constring); |
107 | 107 | |
108 | 108 | if ($this->searchPath !== null) { |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * is based on how postgres names sequences for SERIAL columns |
127 | 127 | */ |
128 | 128 | |
129 | - $sequenceName = $this->getQuotedName($table . '_id_seq'); |
|
129 | + $sequenceName = $this->getQuotedName($table.'_id_seq'); |
|
130 | 130 | $lastSequence = null; |
131 | 131 | |
132 | 132 | try { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | if (!$lastSequence) { |
141 | 141 | $primaryKeys = $this->getPrimaryKey($table); |
142 | 142 | $pkName = array_shift($primaryKeys); |
143 | - $lastSequence = $this->getDbh()->lastInsertId($this->getQuotedName($table . '_' . $pkName . '_seq')); |
|
143 | + $lastSequence = $this->getDbh()->lastInsertId($this->getQuotedName($table.'_'.$pkName.'_seq')); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | return $lastSequence; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $stmt = $this->executeQuery($query, []); |
168 | 168 | $columns = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
169 | 169 | foreach ($columns as $column) { |
170 | - $primaryKey []= $column['attname']; |
|
170 | + $primaryKey [] = $column['attname']; |
|
171 | 171 | } |
172 | 172 | $this->primaryKeys[$tableName] = $primaryKey; |
173 | 173 | } |
@@ -58,18 +58,18 @@ discard block |
||
58 | 58 | foreach ($criteria as $k => $v) { |
59 | 59 | if (strpos(strtolower($k), ' like') > 0) { |
60 | 60 | $k = str_replace(' like', '', strtolower($k)); |
61 | - $params[] = $this->getQuotedName($k) . " LIKE ? "; |
|
61 | + $params[] = $this->getQuotedName($k)." LIKE ? "; |
|
62 | 62 | } else { |
63 | - $params[] = $this->getQuotedName($k) . " = ? "; |
|
63 | + $params[] = $this->getQuotedName($k)." = ? "; |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | - return 'WHERE ' . implode('AND ', $params); |
|
67 | + return 'WHERE '.implode('AND ', $params); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | public function getQuotedName($name) |
71 | 71 | { |
72 | - return '[' . str_replace('.', '].[', $name) . ']'; |
|
72 | + return '['.str_replace('.', '].[', $name).']'; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $columns = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
94 | 94 | |
95 | 95 | foreach ($columns as $column) { |
96 | - $primaryKey []= $column['Column_Name']; |
|
96 | + $primaryKey [] = $column['Column_Name']; |
|
97 | 97 | } |
98 | 98 | $this->primaryKeys[$tableName] = $primaryKey; |
99 | 99 | } |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | |
43 | 43 | protected function retrieveAndPrintHtml($suite) |
44 | 44 | { |
45 | - $tempFile = tempnam(sys_get_temp_dir(), 'C3') . '.tar'; |
|
45 | + $tempFile = tempnam(sys_get_temp_dir(), 'C3').'.tar'; |
|
46 | 46 | file_put_contents($tempFile, $this->c3Request('html')); |
47 | 47 | |
48 | - $destDir = Configuration::outputDir() . $suite . '.remote.coverage'; |
|
48 | + $destDir = Configuration::outputDir().$suite.'.remote.coverage'; |
|
49 | 49 | if (is_dir($destDir)) { |
50 | 50 | FileSystem::doEmptyDir($destDir); |
51 | 51 | } else { |
@@ -60,22 +60,22 @@ discard block |
||
60 | 60 | |
61 | 61 | protected function retrieveAndPrintXml($suite) |
62 | 62 | { |
63 | - $destFile = Configuration::outputDir() . $suite . '.remote.coverage.xml'; |
|
63 | + $destFile = Configuration::outputDir().$suite.'.remote.coverage.xml'; |
|
64 | 64 | file_put_contents($destFile, $this->c3Request('clover')); |
65 | 65 | } |
66 | 66 | |
67 | 67 | protected function retrieveAndPrintCrap4j($suite) |
68 | 68 | { |
69 | - $destFile = Configuration::outputDir() . $suite . '.remote.crap4j.xml'; |
|
69 | + $destFile = Configuration::outputDir().$suite.'.remote.crap4j.xml'; |
|
70 | 70 | file_put_contents($destFile, $this->c3Request('crap4j')); |
71 | 71 | } |
72 | 72 | |
73 | 73 | protected function retrieveAndPrintPHPUnit($suite) |
74 | 74 | { |
75 | - $tempFile = tempnam(sys_get_temp_dir(), 'C3') . '.tar'; |
|
75 | + $tempFile = tempnam(sys_get_temp_dir(), 'C3').'.tar'; |
|
76 | 76 | file_put_contents($tempFile, $this->c3Request('phpunit')); |
77 | 77 | |
78 | - $destDir = Configuration::outputDir() . $suite . '.remote.coverage-phpunit'; |
|
78 | + $destDir = Configuration::outputDir().$suite.'.remote.coverage-phpunit'; |
|
79 | 79 | if (is_dir($destDir)) { |
80 | 80 | FileSystem::doEmptyDir($destDir); |
81 | 81 | } else { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | return (new Template($this->template)) |
85 | - ->place('namespace', $namespace ? $namespace . '\\' : '') |
|
85 | + ->place('namespace', $namespace ? $namespace.'\\' : '') |
|
86 | 86 | ->place('hash', self::genHash($this->modules, $this->settings)) |
87 | 87 | ->place('name', $this->name) |
88 | 88 | ->place('methods', implode("\n\n ", $code)) |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $doc = "*"; |
104 | 104 | } |
105 | 105 | |
106 | - $conditionalDoc = $doc . "\n * Conditional Assertion: Test won't be stopped on fail"; |
|
106 | + $conditionalDoc = $doc."\n * Conditional Assertion: Test won't be stopped on fail"; |
|
107 | 107 | |
108 | 108 | $methodTemplate = (new Template($this->methodTemplate)) |
109 | 109 | ->place('module', $module) |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $type = 'Assertion'; |
116 | 116 | $body .= $methodTemplate |
117 | 117 | ->place('doc', $conditionalDoc) |
118 | - ->place('action', 'can' . ucfirst($refMethod->name)) |
|
118 | + ->place('action', 'can'.ucfirst($refMethod->name)) |
|
119 | 119 | ->place('step', 'ConditionalAssertion') |
120 | 120 | ->produce(); |
121 | 121 | |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | $params = []; |
152 | 152 | foreach ($refMethod->getParameters() as $param) { |
153 | 153 | if ($param->isOptional()) { |
154 | - $params[] = '$' . $param->name . ' = null'; |
|
154 | + $params[] = '$'.$param->name.' = null'; |
|
155 | 155 | } else { |
156 | - $params[] = '$' . $param->name; |
|
156 | + $params[] = '$'.$param->name; |
|
157 | 157 | }; |
158 | 158 | } |
159 | 159 | return implode(', ', $params); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $actions[$moduleName] = get_class_methods(get_class($module)); |
198 | 198 | } |
199 | 199 | |
200 | - return md5(Codecept::VERSION . serialize($actions) . serialize($settings['modules'])); |
|
200 | + return md5(Codecept::VERSION.serialize($actions).serialize($settings['modules'])); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | public function getNumMethods() |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | throw new ModuleException(__CLASS__, ':memory: database is not supported'); |
18 | 18 | } |
19 | 19 | |
20 | - $this->filename = Configuration::projectDir() . $filename; |
|
21 | - $this->dsn = 'sqlite:' . $this->filename; |
|
20 | + $this->filename = Configuration::projectDir().$filename; |
|
21 | + $this->dsn = 'sqlite:'.$this->filename; |
|
22 | 22 | parent::__construct($this->dsn, $user, $password, $options); |
23 | 23 | } |
24 | 24 | |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | { |
34 | 34 | if ($this->hasSnapshot) { |
35 | 35 | $this->dbh = null; |
36 | - file_put_contents($this->filename, file_get_contents($this->filename . '_snapshot')); |
|
36 | + file_put_contents($this->filename, file_get_contents($this->filename.'_snapshot')); |
|
37 | 37 | $this->dbh = new \PDO($this->dsn, $this->user, $this->password); |
38 | 38 | } else { |
39 | - if (file_exists($this->filename . '_snapshot')) { |
|
40 | - unlink($this->filename . '_snapshot'); |
|
39 | + if (file_exists($this->filename.'_snapshot')) { |
|
40 | + unlink($this->filename.'_snapshot'); |
|
41 | 41 | } |
42 | 42 | parent::load($sql); |
43 | - copy($this->filename, $this->filename . '_snapshot'); |
|
43 | + copy($this->filename, $this->filename.'_snapshot'); |
|
44 | 44 | $this->hasSnapshot = true; |
45 | 45 | } |
46 | 46 | } |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | $primaryKey = []; |
61 | - $query = 'PRAGMA table_info(' . $this->getQuotedName($tableName) . ')'; |
|
61 | + $query = 'PRAGMA table_info('.$this->getQuotedName($tableName).')'; |
|
62 | 62 | $stmt = $this->executeQuery($query, []); |
63 | 63 | $columns = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
64 | 64 | |
65 | 65 | foreach ($columns as $column) { |
66 | 66 | if ($column['pk'] !== '0') { |
67 | - $primaryKey []= $column['name']; |
|
67 | + $primaryKey [] = $column['name']; |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 |
@@ -21,19 +21,19 @@ discard block |
||
21 | 21 | 'region' => $config['region'], |
22 | 22 | ]; |
23 | 23 | |
24 | - if (! empty($config['key']) && ! empty($config['secret'])) { |
|
24 | + if (!empty($config['key']) && !empty($config['secret'])) { |
|
25 | 25 | $params['credentials'] = new Credentials($config['key'], $config['secret']); |
26 | 26 | } |
27 | 27 | |
28 | - if (! empty($config['profile'])) { |
|
28 | + if (!empty($config['profile'])) { |
|
29 | 29 | $params['profile'] = $config['profile']; |
30 | 30 | } |
31 | 31 | |
32 | - if (! empty($config['version'])) { |
|
32 | + if (!empty($config['version'])) { |
|
33 | 33 | $params['version'] = $config['version']; |
34 | 34 | } |
35 | 35 | |
36 | - if (! empty($config['endpoint'])) { |
|
36 | + if (!empty($config['endpoint'])) { |
|
37 | 37 | $params['endpoint'] = $config['endpoint']; |
38 | 38 | } |
39 | 39 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | return $queueURL; |
138 | 138 | } |
139 | 139 | } |
140 | - throw new TestRuntimeException('queue [' . $queue . '] not found'); |
|
140 | + throw new TestRuntimeException('queue ['.$queue.'] not found'); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | public function getRequiredConfig() |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $interfaces = class_implements($commandClass); |
83 | 83 | |
84 | 84 | if (!in_array('Codeception\CustomCommandInterface', $interfaces)) { |
85 | - throw new ConfigurationException("Extension: Command {$commandClass} must implement " . |
|
85 | + throw new ConfigurationException("Extension: Command {$commandClass} must implement ". |
|
86 | 86 | "the interface `Codeception\\CustomCommandInterface`"); |
87 | 87 | } |
88 | 88 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $this->preloadConfiguration($argv[++$i]); |
151 | 151 | } |
152 | 152 | if (!empty($match[1])) { |
153 | - $argvWithoutConfig[] = "-" . $match[1]; //rest commands |
|
153 | + $argvWithoutConfig[] = "-".$match[1]; //rest commands |
|
154 | 154 | } |
155 | 155 | continue; |
156 | 156 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | implode( |
138 | 138 | ', ', |
139 | 139 | array_map( |
140 | - function ($module) { |
|
140 | + function($module) { |
|
141 | 141 | return $module->_getName(); |
142 | 142 | }, |
143 | 143 | $e->getSuite()->getModules() |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | return $path; |
218 | 218 | } |
219 | 219 | |
220 | - return codecept_output_dir() . $path; |
|
220 | + return codecept_output_dir().$path; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | public function testSuccess(TestEvent $e) |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | $metaStep = $e->getStep()->getMetaStep(); |
296 | 296 | if ($metaStep and $this->metaStep != $metaStep) { |
297 | - $this->message(' ' . $metaStep->getPrefix()) |
|
297 | + $this->message(' '.$metaStep->getPrefix()) |
|
298 | 298 | ->style('bold') |
299 | 299 | ->append($metaStep->__toString()) |
300 | 300 | ->writeln(); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $messages = Notification::all(); |
333 | 333 | foreach (array_count_values($messages) as $message => $count) { |
334 | 334 | if ($count > 1) { |
335 | - $message = $count . 'x ' . $message; |
|
335 | + $message = $count.'x '.$message; |
|
336 | 336 | } |
337 | 337 | $this->output->notification($message); |
338 | 338 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $failedTest = $e->getTest(); |
344 | 344 | $fail = $e->getFail(); |
345 | 345 | |
346 | - $this->output->write($e->getCount() . ") "); |
|
346 | + $this->output->write($e->getCount().") "); |
|
347 | 347 | $this->writeCurrentTest($failedTest, false); |
348 | 348 | $this->output->writeln(''); |
349 | 349 | $this->message("<error> Test </error> ") |
@@ -407,11 +407,11 @@ discard block |
||
407 | 407 | public function printScenarioFail(ScenarioDriven $failedTest, $fail) |
408 | 408 | { |
409 | 409 | if ($this->conditionalFails) { |
410 | - $failedStep = (string) array_shift($this->conditionalFails); |
|
410 | + $failedStep = (string)array_shift($this->conditionalFails); |
|
411 | 411 | } else { |
412 | - $failedStep = (string) $failedTest->getScenario()->getMetaStep(); |
|
412 | + $failedStep = (string)$failedTest->getScenario()->getMetaStep(); |
|
413 | 413 | if ($failedStep === '') { |
414 | - $failedStep = (string) array_shift($this->failedStep); |
|
414 | + $failedStep = (string)array_shift($this->failedStep); |
|
415 | 415 | } |
416 | 416 | } |
417 | 417 | |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | $message->writeln(); |
466 | 466 | continue; |
467 | 467 | } |
468 | - $message->append($step['file'] . ':' . $step['line']); |
|
468 | + $message->append($step['file'].':'.$step['line']); |
|
469 | 469 | $message->writeln(); |
470 | 470 | } |
471 | 471 | |
@@ -535,14 +535,14 @@ discard block |
||
535 | 535 | if (getenv('COLUMNS')) { |
536 | 536 | $this->width = getenv('COLUMNS'); |
537 | 537 | } else { |
538 | - $this->width = (int) (`command -v tput >> /dev/null 2>&1 && tput cols`) - 2; |
|
538 | + $this->width = (int)(`command -v tput >> /dev/null 2>&1 && tput cols`) - 2; |
|
539 | 539 | } |
540 | 540 | } elseif ($this->isWin() && (php_sapi_name() === "cli")) { |
541 | 541 | exec('mode con', $output); |
542 | 542 | if (isset($output[4])) { |
543 | 543 | preg_match('/^ +.* +(\d+)$/', $output[4], $matches); |
544 | 544 | if (!empty($matches[1])) { |
545 | - $this->width = (int) $matches[1]; |
|
545 | + $this->width = (int)$matches[1]; |
|
546 | 546 | } |
547 | 547 | } |
548 | 548 | } |