@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $question = "? $question"; |
81 | 81 | $dialog = new QuestionHelper(); |
82 | 82 | if (is_array($answer)) { |
83 | - $question .= " <info>(" . $answer[0] . ")</info> "; |
|
83 | + $question .= " <info>(".$answer[0].")</info> "; |
|
84 | 84 | return $dialog->ask($this->input, $this->output, new ChoiceQuestion($question, $answer, 0)); |
85 | 85 | } |
86 | 86 | if (is_bool($answer)) { |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | protected function createHelper($name, $directory) |
117 | 117 | { |
118 | 118 | $file = $this->createDirectoryFor( |
119 | - $dir = $directory . DIRECTORY_SEPARATOR . "Helper", |
|
119 | + $dir = $directory.DIRECTORY_SEPARATOR."Helper", |
|
120 | 120 | "$name.php" |
121 | - ) . "$name.php"; |
|
121 | + )."$name.php"; |
|
122 | 122 | |
123 | 123 | $gen = new Lib\Generator\Helper($name, $this->namespace); |
124 | 124 | // generate helper |
@@ -133,19 +133,19 @@ discard block |
||
133 | 133 | protected function createEmptyDirectory($dir) |
134 | 134 | { |
135 | 135 | $this->createDirectoryFor($dir); |
136 | - $this->createFile($dir . DIRECTORY_SEPARATOR . '.gitkeep', ''); |
|
136 | + $this->createFile($dir.DIRECTORY_SEPARATOR.'.gitkeep', ''); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | protected function gitIgnore($path) |
140 | 140 | { |
141 | 141 | if (file_exists(self::GIT_IGNORE)) { |
142 | - file_put_contents($path . DIRECTORY_SEPARATOR . self::GIT_IGNORE, "*\n!" . self::GIT_IGNORE); |
|
142 | + file_put_contents($path.DIRECTORY_SEPARATOR.self::GIT_IGNORE, "*\n!".self::GIT_IGNORE); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | 146 | protected function checkInstalled($dir = '.') |
147 | 147 | { |
148 | - if (file_exists($dir . DIRECTORY_SEPARATOR . 'codeception.yml') || file_exists($dir . DIRECTORY_SEPARATOR . 'codeception.dist.yml')) { |
|
148 | + if (file_exists($dir.DIRECTORY_SEPARATOR.'codeception.yml') || file_exists($dir.DIRECTORY_SEPARATOR.'codeception.dist.yml')) { |
|
149 | 149 | throw new \Exception("Codeception is already installed in this directory"); |
150 | 150 | } |
151 | 151 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $file = $this->createDirectoryFor( |
156 | 156 | $directory, |
157 | 157 | $name |
158 | - ) . $this->getShortClassName($name); |
|
158 | + ).$this->getShortClassName($name); |
|
159 | 159 | $file .= '.php'; |
160 | 160 | |
161 | 161 | $suiteConfig['namespace'] = $this->namespace; |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | $actionsGenerator = new Lib\Generator\Actions($config); |
172 | 172 | $content = $actionsGenerator->produce(); |
173 | 173 | |
174 | - $generatedDir = $directory . DIRECTORY_SEPARATOR . '_generated'; |
|
174 | + $generatedDir = $directory.DIRECTORY_SEPARATOR.'_generated'; |
|
175 | 175 | $this->createDirectoryFor($generatedDir, 'Actions.php'); |
176 | - $this->createFile($generatedDir . DIRECTORY_SEPARATOR . $actorGenerator->getActorName() . 'Actions.php', $content); |
|
176 | + $this->createFile($generatedDir.DIRECTORY_SEPARATOR.$actorGenerator->getActorName().'Actions.php', $content); |
|
177 | 177 | $this->sayInfo("Actions have been loaded"); |
178 | 178 | } |
179 | 179 | } |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | $value = array_pop($keys); |
35 | 35 | $yaml = ''; |
36 | 36 | for ($ind = 0; count($keys); $ind += 2) { |
37 | - $yaml .= "\n" . str_repeat(' ', $ind) . array_shift($keys) . ': '; |
|
37 | + $yaml .= "\n".str_repeat(' ', $ind).array_shift($keys).': '; |
|
38 | 38 | } |
39 | 39 | $yaml .= $value; |
40 | 40 | try { |
41 | 41 | $config = Yaml::parse($yaml); |
42 | 42 | } catch (ParseException $e) { |
43 | - throw new \Codeception\Exception\ParseException("Overridden config can't be parsed: \n$yaml\n" . $e->getParsedLine()); |
|
43 | + throw new \Codeception\Exception\ParseException("Overridden config can't be parsed: \n$yaml\n".$e->getParsedLine()); |
|
44 | 44 | } |
45 | 45 | $updatedConfig = array_merge_recursive($updatedConfig, $config); |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $config = ['extensions' => ['enabled' => []]]; |
53 | 53 | foreach ($extensions as $name) { |
54 | 54 | if (!class_exists($name)) { |
55 | - $className = 'Codeception\\Extension\\' . ucfirst($name); |
|
55 | + $className = 'Codeception\\Extension\\'.ucfirst($name); |
|
56 | 56 | if (!class_exists($className)) { |
57 | 57 | throw new InvalidOptionException("Extension $name can't be loaded (tried by $name and $className)"); |
58 | 58 | } |
@@ -53,9 +53,9 @@ |
||
53 | 53 | $seconds_input = $e->getTime(); |
54 | 54 | // stack overflow: http://stackoverflow.com/questions/16825240/how-to-convert-microtime-to-hhmmssuu |
55 | 55 | $seconds = (int)($milliseconds = (int)($seconds_input * 1000)) / 1000; |
56 | - $time = ($seconds % 60) . (($milliseconds === 0) ? '' : '.' . $milliseconds); |
|
56 | + $time = ($seconds % 60).(($milliseconds === 0) ? '' : '.'.$milliseconds); |
|
57 | 57 | |
58 | 58 | $this->write(Descriptor::getTestSignature($e->getTest())); |
59 | - $this->writeln(' (' . $time . 's)'); |
|
59 | + $this->writeln(' ('.$time.'s)'); |
|
60 | 60 | } |
61 | 61 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | |
252 | 252 | private function readSql() |
253 | 253 | { |
254 | - if (!file_exists(Configuration::projectDir() . $this->config['dump'])) { |
|
254 | + if (!file_exists(Configuration::projectDir().$this->config['dump'])) { |
|
255 | 255 | throw new ModuleConfigException( |
256 | 256 | __CLASS__, |
257 | 257 | "\nFile with dump doesn't exist.\n" |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | ); |
261 | 261 | } |
262 | 262 | |
263 | - $sql = file_get_contents(Configuration::projectDir() . $this->config['dump']); |
|
263 | + $sql = file_get_contents(Configuration::projectDir().$this->config['dump']); |
|
264 | 264 | |
265 | 265 | // remove C-style comments (except MySQL directives) |
266 | 266 | $sql = preg_replace('%/\*(?!!\d+).*?\*/%s', '', $sql); |
@@ -278,13 +278,13 @@ discard block |
||
278 | 278 | } catch (\PDOException $e) { |
279 | 279 | $message = $e->getMessage(); |
280 | 280 | if ($message === 'could not find driver') { |
281 | - list ($missingDriver, ) = explode(':', $this->config['dsn'], 2); |
|
281 | + list ($missingDriver,) = explode(':', $this->config['dsn'], 2); |
|
282 | 282 | $message = "could not find $missingDriver driver"; |
283 | 283 | } |
284 | 284 | |
285 | - throw new ModuleException(__CLASS__, $message . ' while creating PDO connection'); |
|
285 | + throw new ModuleException(__CLASS__, $message.' while creating PDO connection'); |
|
286 | 286 | } |
287 | - $this->debugSection('Db', 'Connected to ' . $this->driver->getDb()); |
|
287 | + $this->debugSection('Db', 'Connected to '.$this->driver->getDb()); |
|
288 | 288 | $this->dbh = $this->driver->getDbh(); |
289 | 289 | } |
290 | 290 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | try { |
323 | 323 | $this->driver->deleteQueryByCriteria($row['table'], $row['primary']); |
324 | 324 | } catch (\Exception $e) { |
325 | - $this->debug("couldn't delete record " . json_encode($row['primary']) ." from {$row['table']}"); |
|
325 | + $this->debug("couldn't delete record ".json_encode($row['primary'])." from {$row['table']}"); |
|
326 | 326 | } |
327 | 327 | } |
328 | 328 | $this->insertedRows = []; |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $primary[$column] = $row[$column]; |
423 | 423 | } else { |
424 | 424 | throw new \InvalidArgumentException( |
425 | - 'Primary key field ' . $column . ' is not set for table ' . $table |
|
425 | + 'Primary key field '.$column.' is not set for table '.$table |
|
426 | 426 | ); |
427 | 427 | } |
428 | 428 | } |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | $this->assertGreaterThan( |
444 | 444 | 0, |
445 | 445 | $res, |
446 | - 'No matching records found for criteria ' . json_encode($criteria) . ' in table ' . $table |
|
446 | + 'No matching records found for criteria '.json_encode($criteria).' in table '.$table |
|
447 | 447 | ); |
448 | 448 | } |
449 | 449 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | $this->assertLessThan( |
483 | 483 | 1, |
484 | 484 | $count, |
485 | - 'Unexpectedly found matching records for criteria ' . json_encode($criteria) . ' in table ' . $table |
|
485 | + 'Unexpectedly found matching records for criteria '.json_encode($criteria).' in table '.$table |
|
486 | 486 | ); |
487 | 487 | } |
488 | 488 | |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | */ |
497 | 497 | protected function countInDatabase($table, array $criteria = []) |
498 | 498 | { |
499 | - return (int) $this->proceedSeeInDatabase($table, 'count(*)', $criteria); |
|
499 | + return (int)$this->proceedSeeInDatabase($table, 'count(*)', $criteria); |
|
500 | 500 | } |
501 | 501 | |
502 | 502 | protected function proceedSeeInDatabase($table, $column, $criteria) |
@@ -36,7 +36,7 @@ |
||
36 | 36 | if (class_exists($template)) { |
37 | 37 | $className = $template; |
38 | 38 | } else { |
39 | - $className = 'Codeception\Template\\' . ucfirst($template); |
|
39 | + $className = 'Codeception\Template\\'.ucfirst($template); |
|
40 | 40 | |
41 | 41 | if (!class_exists($className)) { |
42 | 42 | throw new \Exception("Template from a $className can't be loaded; Init can't be executed"); |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | { |
45 | 45 | $actorGenerator = new ActorGenerator($settings); |
46 | 46 | $this->output->writeln( |
47 | - '<info>' . Configuration::config()['namespace'] . '\\' . $actorGenerator->getActorName() |
|
48 | - . "</info> includes modules: " . implode(', ', $actorGenerator->getModules()) |
|
47 | + '<info>'.Configuration::config()['namespace'].'\\'.$actorGenerator->getActorName() |
|
48 | + . "</info> includes modules: ".implode(', ', $actorGenerator->getModules()) |
|
49 | 49 | ); |
50 | 50 | |
51 | 51 | $content = $actorGenerator->produce(); |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | $file = $this->createDirectoryFor( |
54 | 54 | Configuration::supportDir(), |
55 | 55 | $settings['actor'] |
56 | - ) . $this->getShortClassName($settings['actor']); |
|
57 | - $file .= '.php'; |
|
56 | + ).$this->getShortClassName($settings['actor']); |
|
57 | + $file .= '.php'; |
|
58 | 58 | return $this->createFile($file, $content); |
59 | 59 | } |
60 | 60 | |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | $actionsGenerator = new ActionsGenerator($settings); |
64 | 64 | $this->output->writeln( |
65 | 65 | " -> {$settings['actor']}Actions.php generated successfully. " |
66 | - . $actionsGenerator->getNumMethods() . " methods added" |
|
66 | + . $actionsGenerator->getNumMethods()." methods added" |
|
67 | 67 | ); |
68 | 68 | |
69 | 69 | $content = $actionsGenerator->produce(); |
70 | 70 | |
71 | - $file = $this->createDirectoryFor(Configuration::supportDir() . '_generated', $settings['actor']); |
|
72 | - $file .= $this->getShortClassName($settings['actor']) . 'Actions.php'; |
|
71 | + $file = $this->createDirectoryFor(Configuration::supportDir().'_generated', $settings['actor']); |
|
72 | + $file .= $this->getShortClassName($settings['actor']).'Actions.php'; |
|
73 | 73 | return $this->createFile($file, $content, true); |
74 | 74 | } |
75 | 75 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | $suites = $this->getSuites(); |
79 | 79 | if (!empty($suites)) { |
80 | - $this->output->writeln("<info>Building Actor classes for suites: " . implode(', ', $suites) . '</info>'); |
|
80 | + $this->output->writeln("<info>Building Actor classes for suites: ".implode(', ', $suites).'</info>'); |
|
81 | 81 | } |
82 | 82 | foreach ($suites as $suite) { |
83 | 83 | $settings = $this->getSuiteConfig($suite); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | foreach ($config['include'] as $subConfig) { |
104 | 104 | $this->output->writeln("\n<comment>Included Configuration: $subConfig</comment>"); |
105 | - $this->buildActorsForConfig($dir . DIRECTORY_SEPARATOR . $subConfig); |
|
105 | + $this->buildActorsForConfig($dir.DIRECTORY_SEPARATOR.$subConfig); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | } |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | $this->say("Like accessing frameworks, ORM, Database."); |
49 | 49 | $haveTester = $this->ask("Do you wish to enable them?", false); |
50 | 50 | |
51 | - $this->createEmptyDirectory($outputDir = $dir . DIRECTORY_SEPARATOR . '_output'); |
|
52 | - $this->createEmptyDirectory($supportDir = $dir . DIRECTORY_SEPARATOR . '_support'); |
|
51 | + $this->createEmptyDirectory($outputDir = $dir.DIRECTORY_SEPARATOR.'_output'); |
|
52 | + $this->createEmptyDirectory($supportDir = $dir.DIRECTORY_SEPARATOR.'_support'); |
|
53 | 53 | |
54 | 54 | $configFile = (new Template($this->configTemplate)) |
55 | 55 | ->place('dir', $dir) |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | if ($this->namespace) { |
60 | 60 | $namespace = rtrim($this->namespace, '\\'); |
61 | - $configFile = "namespace: $namespace\n" . $configFile; |
|
61 | + $configFile = "namespace: $namespace\n".$configFile; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $this->createFile('codeception.yml', $configFile); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | $this->config = $config; |
32 | 32 | $command = $this->config['populator']; |
33 | - $this->builtCommand = $this->buildCommand((string) $command); |
|
33 | + $this->builtCommand = $this->buildCommand((string)$command); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | |
94 | 94 | if (0 !== $exitCode) { |
95 | 95 | throw new \RuntimeException( |
96 | - "The populator command did not end successfully: \n" . |
|
97 | - " Exit code: $exitCode \n" . |
|
98 | - " Output:" . implode("\n", $output) |
|
96 | + "The populator command did not end successfully: \n". |
|
97 | + " Exit code: $exitCode \n". |
|
98 | + " Output:".implode("\n", $output) |
|
99 | 99 | ); |
100 | 100 | } |
101 | 101 |
@@ -52,20 +52,20 @@ discard block |
||
52 | 52 | |
53 | 53 | $config = $this->getGlobalConfig(); |
54 | 54 | if (!$actor) { |
55 | - $actor = ucfirst($suite) . $config['actor_suffix']; |
|
55 | + $actor = ucfirst($suite).$config['actor_suffix']; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | $dir = Configuration::testsDir(); |
59 | - if (file_exists($dir . $suite . '.suite.yml')) { |
|
59 | + if (file_exists($dir.$suite.'.suite.yml')) { |
|
60 | 60 | throw new \Exception("Suite configuration file '$suite.suite.yml' already exists."); |
61 | 61 | } |
62 | 62 | |
63 | - $this->createDirectoryFor($dir . $suite); |
|
63 | + $this->createDirectoryFor($dir.$suite); |
|
64 | 64 | |
65 | 65 | if ($config['settings']['bootstrap']) { |
66 | 66 | // generate bootstrap file |
67 | 67 | $this->createFile( |
68 | - $dir . $suite . DIRECTORY_SEPARATOR . $config['settings']['bootstrap'], |
|
68 | + $dir.$suite.DIRECTORY_SEPARATOR.$config['settings']['bootstrap'], |
|
69 | 69 | "<?php\n", |
70 | 70 | true |
71 | 71 | ); |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | $helperName = ucfirst($suite); |
75 | 75 | |
76 | 76 | $file = $this->createDirectoryFor( |
77 | - Configuration::supportDir() . "Helper", |
|
77 | + Configuration::supportDir()."Helper", |
|
78 | 78 | "$helperName.php" |
79 | - ) . "$helperName.php"; |
|
79 | + )."$helperName.php"; |
|
80 | 80 | |
81 | 81 | $gen = new Helper($helperName, $config['namespace']); |
82 | 82 | // generate helper |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $gen->produce() |
86 | 86 | ); |
87 | 87 | |
88 | - $output->writeln("Helper <info>" . $gen->getHelperName() . "</info> was created in $file"); |
|
88 | + $output->writeln("Helper <info>".$gen->getHelperName()."</info> was created in $file"); |
|
89 | 89 | |
90 | 90 | $yamlSuiteConfigTemplate = <<<EOF |
91 | 91 | actor: {{actor}} |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | EOF; |
96 | 96 | |
97 | 97 | $this->createFile( |
98 | - $dir . $suite . '.suite.yml', |
|
98 | + $dir.$suite.'.suite.yml', |
|
99 | 99 | $yamlSuiteConfig = (new Template($yamlSuiteConfigTemplate)) |
100 | 100 | ->place('actor', $actor) |
101 | 101 | ->place('helper', $gen->getHelperName()) |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | $file = $this->createDirectoryFor( |
111 | 111 | Configuration::supportDir(), |
112 | 112 | $actor |
113 | - ) . $this->getShortClassName($actor); |
|
114 | - $file .= '.php'; |
|
113 | + ).$this->getShortClassName($actor); |
|
114 | + $file .= '.php'; |
|
115 | 115 | |
116 | 116 | $this->createFile($file, $content); |
117 | 117 | |
118 | - $output->writeln("Actor <info>" . $actor . "</info> was created in $file"); |
|
118 | + $output->writeln("Actor <info>".$actor."</info> was created in $file"); |
|
119 | 119 | |
120 | 120 | $output->writeln("Suite config <info>$suite.suite.yml</info> was created."); |
121 | 121 | $output->writeln(' '); |