@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $this->config = array_merge( |
79 | 79 | [ |
80 | 80 | 'cleanup' => true, |
81 | - 'bootstrap' => 'bootstrap' . DIRECTORY_SEPARATOR . 'app.php', |
|
81 | + 'bootstrap' => 'bootstrap'.DIRECTORY_SEPARATOR.'app.php', |
|
82 | 82 | 'root' => '', |
83 | 83 | 'packages' => 'workbench', |
84 | 84 | 'url' => 'http://localhost', |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $projectDir .= $this->config['root']; |
91 | 91 | |
92 | 92 | $this->config['project_dir'] = $projectDir; |
93 | - $this->config['bootstrap_file'] = $projectDir . $this->config['bootstrap']; |
|
93 | + $this->config['bootstrap_file'] = $projectDir.$this->config['bootstrap']; |
|
94 | 94 | |
95 | 95 | parent::__construct($container); |
96 | 96 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | protected function registerAutoloaders() |
169 | 169 | { |
170 | - require $this->config['project_dir'] . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; |
|
170 | + require $this->config['project_dir'].'vendor'.DIRECTORY_SEPARATOR.'autoload.php'; |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | try { |
360 | 360 | return $this->app['db']->table($table)->insertGetId($attributes); |
361 | 361 | } catch (\Exception $e) { |
362 | - $this->fail("Could not insert record into table '$table':\n\n" . $e->getMessage()); |
|
362 | + $this->fail("Could not insert record into table '$table':\n\n".$e->getMessage()); |
|
363 | 363 | } |
364 | 364 | } |
365 | 365 | |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | { |
383 | 383 | if (class_exists($table)) { |
384 | 384 | if (!$this->findModel($table, $attributes)) { |
385 | - $this->fail("Could not find $table with " . json_encode($attributes)); |
|
385 | + $this->fail("Could not find $table with ".json_encode($attributes)); |
|
386 | 386 | } |
387 | 387 | } elseif (!$this->findRecord($table, $attributes)) { |
388 | 388 | $this->fail("Could not find matching record in table '$table'"); |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | { |
409 | 409 | if (class_exists($table)) { |
410 | 410 | if ($this->findModel($table, $attributes)) { |
411 | - $this->fail("Unexpectedly found matching $table with " . json_encode($attributes)); |
|
411 | + $this->fail("Unexpectedly found matching $table with ".json_encode($attributes)); |
|
412 | 412 | } |
413 | 413 | } elseif ($this->findRecord($table, $attributes)) { |
414 | 414 | $this->fail("Unexpectedly found matching record in table '$table'"); |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | { |
437 | 437 | if (class_exists($table)) { |
438 | 438 | if (!$model = $this->findModel($table, $attributes)) { |
439 | - $this->fail("Could not find $table with " . json_encode($attributes)); |
|
439 | + $this->fail("Could not find $table with ".json_encode($attributes)); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | return $model; |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | try { |
511 | 511 | return $this->modelFactory($model, $name)->create($attributes); |
512 | 512 | } catch (\Exception $e) { |
513 | - $this->fail("Could not create model: \n\n" . get_class($e) . "\n\n" . $e->getMessage()); |
|
513 | + $this->fail("Could not create model: \n\n".get_class($e)."\n\n".$e->getMessage()); |
|
514 | 514 | } |
515 | 515 | } |
516 | 516 | |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | try { |
540 | 540 | return $this->modelFactory($model, $name, $times)->create($attributes); |
541 | 541 | } catch (\Exception $e) { |
542 | - $this->fail("Could not create model: \n\n" . get_class($e) . "\n\n" . $e->getMessage()); |
|
542 | + $this->fail("Could not create model: \n\n".get_class($e)."\n\n".$e->getMessage()); |
|
543 | 543 | } |
544 | 544 | } |
545 | 545 | |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | protected function modelFactory($model, $name, $times = 1) |
554 | 554 | { |
555 | 555 | if (!function_exists('factory')) { |
556 | - throw new ModuleException($this, 'The factory() method does not exist. ' . |
|
556 | + throw new ModuleException($this, 'The factory() method does not exist. '. |
|
557 | 557 | 'This functionality relies on Lumen model factories, which were introduced in Lumen 5.1.'); |
558 | 558 | } |
559 | 559 | |
@@ -570,6 +570,6 @@ discard block |
||
570 | 570 | { |
571 | 571 | $server = ReflectionHelper::readPrivateProperty($this->client, 'server'); |
572 | 572 | |
573 | - return ['/^' . str_replace('.', '\.', $server['HTTP_HOST']) . '$/']; |
|
573 | + return ['/^'.str_replace('.', '\.', $server['HTTP_HOST']).'$/']; |
|
574 | 574 | } |
575 | 575 | } |
@@ -231,7 +231,7 @@ |
||
231 | 231 | |
232 | 232 | // set singular value for some params |
233 | 233 | foreach (['skip', 'incomplete'] as $single) { |
234 | - $this->params[$single] = empty($this->params[$single]) ? null : (string) $this->params[$single][0]; |
|
234 | + $this->params[$single] = empty($this->params[$single]) ? null : (string)$this->params[$single][0]; |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $rawExamples = Annotation::forMethod($unit, $method)->fetchAll('example'); |
47 | 47 | if (count($rawExamples)) { |
48 | 48 | $examples = array_map( |
49 | - function ($v) { |
|
49 | + function($v) { |
|
50 | 50 | return Annotation::arrayValue($v); |
51 | 51 | }, |
52 | 52 | $rawExamples |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } catch (\ReflectionException $e) { |
69 | 69 | throw new TestParseException( |
70 | 70 | $file, |
71 | - "DataProvider '$dataMethod' for $testClass->$method is invalid or not callable.\n" . |
|
71 | + "DataProvider '$dataMethod' for $testClass->$method is invalid or not callable.\n". |
|
72 | 72 | "Make sure that the dataprovider exist within the test class." |
73 | 73 | ); |
74 | 74 | } |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | if ($example === null) { |
81 | 81 | throw new TestParseException( |
82 | 82 | $file, |
83 | - "Example for $testClass->$method contains invalid data:\n" . |
|
84 | - $rawExamples[$k] . "\n" . |
|
83 | + "Example for $testClass->$method contains invalid data:\n". |
|
84 | + $rawExamples[$k]."\n". |
|
85 | 85 | "Make sure this is a valid JSON (Hint: \"-char for strings) or a single-line annotation in Doctrine-style" |
86 | 86 | ); |
87 | 87 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'namespace' => null, |
113 | 113 | 'groups' => [], |
114 | 114 | 'shuffle' => false, |
115 | - 'extensions' => [ // suite extensions |
|
115 | + 'extensions' => [// suite extensions |
|
116 | 116 | 'enabled' => [], |
117 | 117 | 'config' => [], |
118 | 118 | ], |
@@ -140,17 +140,17 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | if ($configFile === null) { |
143 | - $configFile = getcwd() . DIRECTORY_SEPARATOR . 'codeception.yml'; |
|
143 | + $configFile = getcwd().DIRECTORY_SEPARATOR.'codeception.yml'; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | if (is_dir($configFile)) { |
147 | - $configFile = $configFile . DIRECTORY_SEPARATOR . 'codeception.yml'; |
|
147 | + $configFile = $configFile.DIRECTORY_SEPARATOR.'codeception.yml'; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | $dir = realpath(dirname($configFile)); |
151 | 151 | self::$dir = $dir; |
152 | 152 | |
153 | - $configDistFile = $dir . DIRECTORY_SEPARATOR . 'codeception.dist.yml'; |
|
153 | + $configDistFile = $dir.DIRECTORY_SEPARATOR.'codeception.dist.yml'; |
|
154 | 154 | |
155 | 155 | if (!(file_exists($configDistFile) || file_exists($configFile))) { |
156 | 156 | throw new ConfigurationException("Configuration file could not be found.\nRun `bootstrap` to initialize Codeception.", 404); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | if (!$bootstrap) { |
247 | 247 | return; |
248 | 248 | } |
249 | - $bootstrap = self::$dir . DIRECTORY_SEPARATOR . self::$testsDir . DIRECTORY_SEPARATOR . $bootstrap; |
|
249 | + $bootstrap = self::$dir.DIRECTORY_SEPARATOR.self::$testsDir.DIRECTORY_SEPARATOR.$bootstrap; |
|
250 | 250 | if (file_exists($bootstrap)) { |
251 | 251 | include_once $bootstrap; |
252 | 252 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $suites = Finder::create() |
258 | 258 | ->files() |
259 | 259 | ->name('*.{suite,suite.dist}.yml') |
260 | - ->in(self::$dir . DIRECTORY_SEPARATOR . self::$testsDir) |
|
260 | + ->in(self::$dir.DIRECTORY_SEPARATOR.self::$testsDir) |
|
261 | 261 | ->depth('< 1') |
262 | 262 | ->sortByName(); |
263 | 263 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $settings = self::loadSuiteConfig($suite, $config['paths']['tests'], $settings); |
307 | 307 | // load from environment configs |
308 | 308 | if (isset($config['paths']['envs'])) { |
309 | - $envConf = self::loadEnvConfigs(self::$dir . DIRECTORY_SEPARATOR . $config['paths']['envs']); |
|
309 | + $envConf = self::loadEnvConfigs(self::$dir.DIRECTORY_SEPARATOR.$config['paths']['envs']); |
|
310 | 310 | $settings = self::mergeConfigs($settings, $envConf); |
311 | 311 | } |
312 | 312 | |
@@ -320,8 +320,8 @@ discard block |
||
320 | 320 | $settings['path'] = $suite; |
321 | 321 | } |
322 | 322 | |
323 | - $settings['path'] = self::$dir . DIRECTORY_SEPARATOR . $config['paths']['tests'] |
|
324 | - . DIRECTORY_SEPARATOR . $settings['path'] . DIRECTORY_SEPARATOR; |
|
323 | + $settings['path'] = self::$dir.DIRECTORY_SEPARATOR.$config['paths']['tests'] |
|
324 | + . DIRECTORY_SEPARATOR.$settings['path'].DIRECTORY_SEPARATOR; |
|
325 | 325 | |
326 | 326 | |
327 | 327 | |
@@ -357,10 +357,10 @@ discard block |
||
357 | 357 | $envConfig[$env] = []; |
358 | 358 | $envPath = $path; |
359 | 359 | if ($envFile->getRelativePath()) { |
360 | - $envPath .= DIRECTORY_SEPARATOR . $envFile->getRelativePath(); |
|
360 | + $envPath .= DIRECTORY_SEPARATOR.$envFile->getRelativePath(); |
|
361 | 361 | } |
362 | 362 | foreach (['.dist.yml', '.yml'] as $suffix) { |
363 | - $envConf = self::getConfFromFile($envPath . DIRECTORY_SEPARATOR . $env . $suffix, null); |
|
363 | + $envConf = self::getConfFromFile($envPath.DIRECTORY_SEPARATOR.$env.$suffix, null); |
|
364 | 364 | if ($envConf === null) { |
365 | 365 | continue; |
366 | 366 | } |
@@ -457,13 +457,13 @@ discard block |
||
457 | 457 | { |
458 | 458 | return array_filter( |
459 | 459 | array_map( |
460 | - function ($m) { |
|
460 | + function($m) { |
|
461 | 461 | return is_array($m) ? key($m) : $m; |
462 | 462 | }, |
463 | 463 | $settings['modules']['enabled'], |
464 | 464 | array_keys($settings['modules']['enabled']) |
465 | 465 | ), |
466 | - function ($m) use ($settings) { |
|
466 | + function($m) use ($settings) { |
|
467 | 467 | if (!isset($settings['modules']['disabled'])) { |
468 | 468 | return true; |
469 | 469 | } |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | */ |
488 | 488 | public static function dataDir() |
489 | 489 | { |
490 | - return self::$dir . DIRECTORY_SEPARATOR . self::$dataDir . DIRECTORY_SEPARATOR; |
|
490 | + return self::$dir.DIRECTORY_SEPARATOR.self::$dataDir.DIRECTORY_SEPARATOR; |
|
491 | 491 | } |
492 | 492 | |
493 | 493 | /** |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | */ |
499 | 499 | public static function supportDir() |
500 | 500 | { |
501 | - return self::$dir . DIRECTORY_SEPARATOR . self::$supportDir . DIRECTORY_SEPARATOR; |
|
501 | + return self::$dir.DIRECTORY_SEPARATOR.self::$supportDir.DIRECTORY_SEPARATOR; |
|
502 | 502 | } |
503 | 503 | |
504 | 504 | /** |
@@ -514,9 +514,9 @@ discard block |
||
514 | 514 | throw new ConfigurationException("Path for output not specified. Please, set output path in global config"); |
515 | 515 | } |
516 | 516 | |
517 | - $dir = self::$outputDir . DIRECTORY_SEPARATOR; |
|
517 | + $dir = self::$outputDir.DIRECTORY_SEPARATOR; |
|
518 | 518 | if (strcmp(self::$outputDir[0], "/") !== 0) { |
519 | - $dir = self::$dir . DIRECTORY_SEPARATOR . $dir; |
|
519 | + $dir = self::$dir.DIRECTORY_SEPARATOR.$dir; |
|
520 | 520 | } |
521 | 521 | |
522 | 522 | if (!file_exists($dir)) { |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | */ |
554 | 554 | public static function projectDir() |
555 | 555 | { |
556 | - return self::$dir . DIRECTORY_SEPARATOR; |
|
556 | + return self::$dir.DIRECTORY_SEPARATOR; |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | */ |
565 | 565 | public static function testsDir() |
566 | 566 | { |
567 | - return self::$dir . DIRECTORY_SEPARATOR . self::$testsDir . DIRECTORY_SEPARATOR; |
|
567 | + return self::$dir.DIRECTORY_SEPARATOR.self::$testsDir.DIRECTORY_SEPARATOR; |
|
568 | 568 | } |
569 | 569 | |
570 | 570 | /** |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | if (!self::$envsDir) { |
579 | 579 | return null; |
580 | 580 | } |
581 | - return self::$dir . DIRECTORY_SEPARATOR . self::$envsDir . DIRECTORY_SEPARATOR; |
|
581 | + return self::$dir.DIRECTORY_SEPARATOR.self::$envsDir.DIRECTORY_SEPARATOR; |
|
582 | 582 | } |
583 | 583 | |
584 | 584 | /** |
@@ -670,10 +670,10 @@ discard block |
||
670 | 670 | } |
671 | 671 | |
672 | 672 | $suiteDistConf = self::getConfFromFile( |
673 | - self::$dir . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . "$suite.suite.dist.yml" |
|
673 | + self::$dir.DIRECTORY_SEPARATOR.$path.DIRECTORY_SEPARATOR."$suite.suite.dist.yml" |
|
674 | 674 | ); |
675 | 675 | $suiteConf = self::getConfFromFile( |
676 | - self::$dir . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . "$suite.suite.yml" |
|
676 | + self::$dir.DIRECTORY_SEPARATOR.$path.DIRECTORY_SEPARATOR."$suite.suite.yml" |
|
677 | 677 | ); |
678 | 678 | $settings = self::mergeConfigs($settings, $suiteDistConf); |
679 | 679 | $settings = self::mergeConfigs($settings, $suiteConf); |
@@ -709,13 +709,13 @@ discard block |
||
709 | 709 | protected static function expandWildcardsFor($include) |
710 | 710 | { |
711 | 711 | if (1 !== preg_match('/[\?\.\*]/', $include)) { |
712 | - return [$include,]; |
|
712 | + return [$include, ]; |
|
713 | 713 | } |
714 | 714 | |
715 | 715 | try { |
716 | 716 | $configFiles = Finder::create()->files() |
717 | 717 | ->name('/codeception(\.dist\.yml|\.yml)/') |
718 | - ->in(self::$dir . DIRECTORY_SEPARATOR . $include); |
|
718 | + ->in(self::$dir.DIRECTORY_SEPARATOR.$include); |
|
719 | 719 | } catch (\InvalidArgumentException $e) { |
720 | 720 | throw new ConfigurationException( |
721 | 721 | "Configuration file(s) could not be found in \"$include\"." |
@@ -157,10 +157,10 @@ discard block |
||
157 | 157 | $this->config['transaction'] = $this->backupConfig['transaction'] = $this->config['cleanup']; |
158 | 158 | } |
159 | 159 | |
160 | - if (!is_file(Configuration::projectDir() . $this->config['configFile'])) { |
|
160 | + if (!is_file(Configuration::projectDir().$this->config['configFile'])) { |
|
161 | 161 | throw new ModuleConfigException( |
162 | 162 | __CLASS__, |
163 | - "The application config file does not exist: " . Configuration::projectDir() . $this->config['configFile'] |
|
163 | + "The application config file does not exist: ".Configuration::projectDir().$this->config['configFile'] |
|
164 | 164 | ); |
165 | 165 | } |
166 | 166 | $this->defineConstants(); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | ]; |
182 | 182 | $this->client->defaultServerVars['HTTPS'] = parse_url($entryUrl, PHP_URL_SCHEME) === 'https'; |
183 | 183 | $this->client->restoreServerVars(); |
184 | - $this->client->configFile = Configuration::projectDir() . $this->config['configFile']; |
|
184 | + $this->client->configFile = Configuration::projectDir().$this->config['configFile']; |
|
185 | 185 | $this->app = $this->client->getApplication(); |
186 | 186 | |
187 | 187 | // load fixtures before db transaction |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | return call_user_func_array( |
347 | 347 | 'array_merge', |
348 | 348 | array_map( // merge all fixtures from all fixture stores |
349 | - function ($fixturesStore) { |
|
349 | + function($fixturesStore) { |
|
350 | 350 | return $fixturesStore->getFixtures(); |
351 | 351 | }, |
352 | 352 | $this->loadedFixtures |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | { |
432 | 432 | $record = $this->findRecord($model, $attributes); |
433 | 433 | if (!$record) { |
434 | - $this->fail("Couldn't find $model with " . json_encode($attributes)); |
|
434 | + $this->fail("Couldn't find $model with ".json_encode($attributes)); |
|
435 | 435 | } |
436 | 436 | $this->debugSection($model, json_encode($record)); |
437 | 437 | } |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | $record = $this->findRecord($model, $attributes); |
453 | 453 | $this->debugSection($model, json_encode($record)); |
454 | 454 | if ($record) { |
455 | - $this->fail("Unexpectedly managed to find $model with " . json_encode($attributes)); |
|
455 | + $this->fail("Unexpectedly managed to find $model with ".json_encode($attributes)); |
|
456 | 456 | } |
457 | 457 | } |
458 | 458 | |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | $this->assertNotEmpty($this->grabSentEmails(), 'emails were sent'); |
570 | 570 | return; |
571 | 571 | } |
572 | - $this->assertEquals($num, count($this->grabSentEmails()), 'number of sent emails is equal to ' . $num); |
|
572 | + $this->assertEquals($num, count($this->grabSentEmails()), 'number of sent emails is equal to '.$num); |
|
573 | 573 | } |
574 | 574 | |
575 | 575 | /** |
@@ -640,8 +640,8 @@ discard block |
||
640 | 640 | if (strpos($template, '<') !== false) { |
641 | 641 | $template = preg_replace_callback( |
642 | 642 | '/<(?:\w+):?([^>]+)?>/u', |
643 | - function ($matches) use (&$parameters) { |
|
644 | - $key = '#' . count($parameters) . '#'; |
|
643 | + function($matches) use (&$parameters) { |
|
644 | + $key = '#'.count($parameters).'#'; |
|
645 | 645 | $parameters[$key] = isset($matches[1]) ? $matches[1] : '\w+'; |
646 | 646 | return $key; |
647 | 647 | }, |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | } |
651 | 651 | $template = preg_quote($template); |
652 | 652 | $template = strtr($template, $parameters); |
653 | - return '/^' . $template . '$/u'; |
|
653 | + return '/^'.$template.'$/u'; |
|
654 | 654 | } |
655 | 655 | |
656 | 656 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function getLine() |
78 | 78 | { |
79 | 79 | if ($this->line && $this->file) { |
80 | - return codecept_relative_path($this->file) . ':' . $this->line; |
|
80 | + return codecept_relative_path($this->file).':'.$this->line; |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | if ($totalLength > $maxLength && $maxLength > 0) { |
108 | 108 | //sort arguments from shortest to longest |
109 | - uasort($arguments, function ($arg1, $arg2) { |
|
109 | + uasort($arguments, function($arg1, $arg2) { |
|
110 | 110 | $length1 = mb_strlen($arg1, 'utf-8'); |
111 | 111 | $length2 = mb_strlen($arg2, 'utf-8'); |
112 | 112 | if ($length1 === $length2) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | foreach ($arguments as $key => $argument) { |
123 | 123 | $argumentsRemaining--; |
124 | 124 | if (mb_strlen($argument, 'utf-8') > $allowedLength) { |
125 | - $arguments[$key] = mb_substr($argument, 0, $allowedLength - 4, 'utf-8') . '...' . mb_substr($argument, -1, 1, 'utf-8'); |
|
125 | + $arguments[$key] = mb_substr($argument, 0, $allowedLength - 4, 'utf-8').'...'.mb_substr($argument, -1, 1, 'utf-8'); |
|
126 | 126 | $lengthRemaining -= ($allowedLength + 1); |
127 | 127 | } else { |
128 | 128 | $lengthRemaining -= (mb_strlen($arguments[$key], 'utf-8') + 1); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | protected function stringifyArgument($argument) |
144 | 144 | { |
145 | 145 | if (is_string($argument)) { |
146 | - return '"' . strtr($argument, ["\n" => '\n', "\r" => '\r', "\t" => ' ']) . '"'; |
|
146 | + return '"'.strtr($argument, ["\n" => '\n', "\r" => '\r', "\t" => ' ']).'"'; |
|
147 | 147 | } elseif (is_resource($argument)) { |
148 | 148 | $argument = (string)$argument; |
149 | 149 | } elseif (is_array($argument)) { |
@@ -183,10 +183,10 @@ discard block |
||
183 | 183 | |
184 | 184 | public function getPhpCode($maxLength) |
185 | 185 | { |
186 | - $result = "\${$this->prefix}->" . $this->getAction() . '('; |
|
186 | + $result = "\${$this->prefix}->".$this->getAction().'('; |
|
187 | 187 | $maxLength = $maxLength - mb_strlen($result, 'utf-8') - 1; |
188 | 188 | |
189 | - $result .= $this->getHumanizedArguments($maxLength) .')'; |
|
189 | + $result .= $this->getHumanizedArguments($maxLength).')'; |
|
190 | 190 | return $result; |
191 | 191 | } |
192 | 192 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | public function __toString() |
202 | 202 | { |
203 | 203 | $humanizedAction = $this->humanize($this->getAction()); |
204 | - return $humanizedAction . ' ' . $this->getHumanizedArguments(); |
|
204 | + return $humanizedAction.' '.$this->getHumanizedArguments(); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | { |
210 | 210 | $humanizedAction = $this->humanize($this->getAction()); |
211 | 211 | $maxLength = $maxLength - mb_strlen($humanizedAction, 'utf-8') - 1; |
212 | - return $humanizedAction . ' ' . $this->getHumanizedArguments($maxLength); |
|
212 | + return $humanizedAction.' '.$this->getHumanizedArguments($maxLength); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | public function getHtml($highlightColor = '#732E81') |
@@ -296,14 +296,14 @@ discard block |
||
296 | 296 | } |
297 | 297 | |
298 | 298 | // in case arguments were passed by reference, copy args array to ensure dereference. array_values() does not dereference values |
299 | - $this->metaStep = new Step\Meta($step['function'], array_map(function ($i) { |
|
299 | + $this->metaStep = new Step\Meta($step['function'], array_map(function($i) { |
|
300 | 300 | return $i; |
301 | 301 | }, array_values($step['args']))); |
302 | 302 | $this->metaStep->setTraceInfo($step['file'], $step['line']); |
303 | 303 | |
304 | 304 | // pageobjects or other classes should not be included with "I" |
305 | 305 | if (!in_array('Codeception\Actor', class_parents($step['class']))) { |
306 | - $this->metaStep->setPrefix($step['class'] . ':'); |
|
306 | + $this->metaStep->setPrefix($step['class'].':'); |
|
307 | 307 | } |
308 | 308 | return; |
309 | 309 | } |
@@ -322,6 +322,6 @@ discard block |
||
322 | 322 | */ |
323 | 323 | public function getPrefix() |
324 | 324 | { |
325 | - return $this->prefix . ' '; |
|
325 | + return $this->prefix.' '; |
|
326 | 326 | } |
327 | 327 | } |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | |
56 | 56 | $url = $this->ask("Start url for tests", "http://localhost/api"); |
57 | 57 | |
58 | - $this->createEmptyDirectory($outputDir = $dir . DIRECTORY_SEPARATOR . '_output'); |
|
59 | - $this->createEmptyDirectory($dir . DIRECTORY_SEPARATOR . '_data'); |
|
60 | - $this->createDirectoryFor($supportDir = $dir . DIRECTORY_SEPARATOR . '_support'); |
|
61 | - $this->createDirectoryFor($supportDir . DIRECTORY_SEPARATOR . '_generated'); |
|
58 | + $this->createEmptyDirectory($outputDir = $dir.DIRECTORY_SEPARATOR.'_output'); |
|
59 | + $this->createEmptyDirectory($dir.DIRECTORY_SEPARATOR.'_data'); |
|
60 | + $this->createDirectoryFor($supportDir = $dir.DIRECTORY_SEPARATOR.'_support'); |
|
61 | + $this->createDirectoryFor($supportDir.DIRECTORY_SEPARATOR.'_generated'); |
|
62 | 62 | $this->gitIgnore($outputDir); |
63 | - $this->gitIgnore($supportDir . DIRECTORY_SEPARATOR . '_generated'); |
|
63 | + $this->gitIgnore($supportDir.DIRECTORY_SEPARATOR.'_generated'); |
|
64 | 64 | $this->sayInfo("Created test directories inside at $dir"); |
65 | 65 | |
66 | 66 | $configFile = (new Template($this->configTemplate)) |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | if ($this->namespace) { |
72 | 72 | $namespace = rtrim($this->namespace, '\\'); |
73 | - $configFile = "namespace: $namespace\n" . $configFile; |
|
73 | + $configFile = "namespace: $namespace\n".$configFile; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | $this->createFile('codeception.yml', $configFile); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $this->createActor('ApiTester', $supportDir, Yaml::parse($configFile)['suites']['api']); |
79 | 79 | |
80 | 80 | $this->sayInfo("Created global config codeception.yml inside the root directory"); |
81 | - $this->createFile($dir . DIRECTORY_SEPARATOR . 'ApiCest.php', $this->firstTest); |
|
81 | + $this->createFile($dir.DIRECTORY_SEPARATOR.'ApiCest.php', $this->firstTest); |
|
82 | 82 | $this->sayInfo("Created a demo test ApiCest.php"); |
83 | 83 | |
84 | 84 | $this->say(); |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | } |
86 | 86 | $url = $this->ask("Start url for tests", "http://localhost"); |
87 | 87 | |
88 | - $this->createEmptyDirectory($outputDir = $dir . DIRECTORY_SEPARATOR . '_output'); |
|
89 | - $this->createEmptyDirectory($dir . DIRECTORY_SEPARATOR . '_data'); |
|
90 | - $this->createDirectoryFor($supportDir = $dir . DIRECTORY_SEPARATOR . '_support'); |
|
91 | - $this->createDirectoryFor($supportDir . DIRECTORY_SEPARATOR . '_generated'); |
|
88 | + $this->createEmptyDirectory($outputDir = $dir.DIRECTORY_SEPARATOR.'_output'); |
|
89 | + $this->createEmptyDirectory($dir.DIRECTORY_SEPARATOR.'_data'); |
|
90 | + $this->createDirectoryFor($supportDir = $dir.DIRECTORY_SEPARATOR.'_support'); |
|
91 | + $this->createDirectoryFor($supportDir.DIRECTORY_SEPARATOR.'_generated'); |
|
92 | 92 | $this->gitIgnore($outputDir); |
93 | - $this->gitIgnore($supportDir . DIRECTORY_SEPARATOR . '_generated'); |
|
93 | + $this->gitIgnore($supportDir.DIRECTORY_SEPARATOR.'_generated'); |
|
94 | 94 | $this->sayInfo("Created test directories inside at $dir"); |
95 | 95 | |
96 | 96 | $configFile = (new Template($this->configTemplate)) |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | if ($this->namespace) { |
103 | 103 | $namespace = rtrim($this->namespace, '\\'); |
104 | - $configFile = "namespace: $namespace\n" . $configFile; |
|
104 | + $configFile = "namespace: $namespace\n".$configFile; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | $this->createFile('codeception.yml', $configFile); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $this->createActor('AcceptanceTester', $supportDir, Yaml::parse($configFile)['suites']['acceptance']); |
110 | 110 | |
111 | 111 | $this->sayInfo("Created global config codeception.yml inside the root directory"); |
112 | - $this->createFile($dir . DIRECTORY_SEPARATOR . 'LoginCest.php', $this->firstTest); |
|
112 | + $this->createFile($dir.DIRECTORY_SEPARATOR.'LoginCest.php', $this->firstTest); |
|
113 | 113 | $this->sayInfo("Created a demo test LoginCest.php"); |
114 | 114 | |
115 | 115 | $this->say(); |
@@ -97,7 +97,7 @@ |
||
97 | 97 | if (!$process->isRunning()) { |
98 | 98 | continue; |
99 | 99 | } |
100 | - $this->output->debug('[RunProcess] Stopping ' . $process->getCommandLine()); |
|
100 | + $this->output->debug('[RunProcess] Stopping '.$process->getCommandLine()); |
|
101 | 101 | $process->stop(); |
102 | 102 | } |
103 | 103 | $this->processes = []; |