@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | if (isset($version)) { |
30 | 30 | $project = array_map( |
31 | - function ($item) use ($version) { |
|
31 | + function($item) use ($version) { |
|
32 | 32 | return "$item:$version"; |
33 | 33 | }, |
34 | 34 | $project |
@@ -2,7 +2,7 @@ |
||
2 | 2 | $I = new CliGuy($scenario); |
3 | 3 | |
4 | 4 | $I->wantTo('copy dir recursively with CopyDir task, but exclude a file'); |
5 | -$I->amInPath(codecept_data_dir().'sandbox'); |
|
5 | +$I->amInPath(codecept_data_dir() . 'sandbox'); |
|
6 | 6 | $I->seeDirFound('some/deeply/nested'); |
7 | 7 | $I->seeDirFound('some/deeply/nested2'); |
8 | 8 | $I->seeDirFound('some/deeply/nested3'); |
@@ -235,7 +235,7 @@ |
||
235 | 235 | } |
236 | 236 | |
237 | 237 | $this->version = array_intersect_key($matches, $this->version); |
238 | - $this->version = array_map(function ($item) { |
|
238 | + $this->version = array_map(function($item) { |
|
239 | 239 | return $item[0]; |
240 | 240 | }, $this->version); |
241 | 241 | } |
@@ -73,9 +73,9 @@ |
||
73 | 73 | */ |
74 | 74 | private static function getClassKey($key) |
75 | 75 | { |
76 | - $configPrefix = static::configPrefix(); // task. |
|
77 | - $configClass = static::configClassIdentifier(get_called_class()); // PARTIAL_NAMESPACE.CLASSNAME |
|
78 | - $configPostFix = static::configPostfix(); // .settings |
|
76 | + $configPrefix = static::configPrefix(); // task. |
|
77 | + $configClass = static::configClassIdentifier(get_called_class()); // PARTIAL_NAMESPACE.CLASSNAME |
|
78 | + $configPostFix = static::configPostfix(); // .settings |
|
79 | 79 | |
80 | 80 | return sprintf('%s%s%s.%s', $configPrefix, $configClass, $configPostFix, $key); |
81 | 81 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public static function escapeArgument($argument) |
36 | 36 | { |
37 | - @trigger_error('The '.__METHOD__.'() method is a copy of a method that was deprecated by Symfony 3.3 and removed in Symfony 4; it will be removed in Robo 2.0.', E_USER_DEPRECATED); |
|
37 | + @trigger_error('The ' . __METHOD__ . '() method is a copy of a method that was deprecated by Symfony 3.3 and removed in Symfony 4; it will be removed in Robo 2.0.', E_USER_DEPRECATED); |
|
38 | 38 | |
39 | 39 | //Fix for PHP bug #43784 escapeshellarg removes % from given string |
40 | 40 | //Fix for PHP bug #49446 escapeshellarg doesn't work on Windows |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $escapedArgument .= '\\"'; |
53 | 53 | } elseif (self::isSurroundedBy($part, '%')) { |
54 | 54 | // Avoid environment variable expansion |
55 | - $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%'; |
|
55 | + $escapedArgument .= '^%"' . substr($part, 1, -1) . '"^%'; |
|
56 | 56 | } else { |
57 | 57 | // escape trailing backslash |
58 | 58 | if ('\\' === substr($part, -1)) { |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | } |
64 | 64 | } |
65 | 65 | if ($quote) { |
66 | - $escapedArgument = '"'.$escapedArgument.'"'; |
|
66 | + $escapedArgument = '"' . $escapedArgument . '"'; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return $escapedArgument; |
70 | 70 | } |
71 | 71 | |
72 | - return "'".str_replace("'", "'\\''", $argument)."'"; |
|
72 | + return "'" . str_replace("'", "'\\''", $argument) . "'"; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | private static function isSurroundedBy($arg, $char) |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | $I->wantTo('set iterable in the __constructor'); |
42 | 42 | $I |
43 | 43 | ->taskForEach($example['items']) |
44 | - ->withBuilder(function (CollectionBuilder $builder, $key, $value) use (&$actual) { |
|
45 | - $builder->addCode(function () use ($key, $value, &$actual) { |
|
44 | + ->withBuilder(function(CollectionBuilder $builder, $key, $value) use (&$actual) { |
|
45 | + $builder->addCode(function() use ($key, $value, &$actual) { |
|
46 | 46 | $actual[] = "$key = $value"; |
47 | 47 | |
48 | 48 | return 0; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $I->wantTo('set iterable with deferTaskConfiguration()'); |
64 | 64 | $I |
65 | 65 | ->collectionBuilder() |
66 | - ->addCode(function (Data $data) use ($example) { |
|
66 | + ->addCode(function(Data $data) use ($example) { |
|
67 | 67 | $data['items'] = $example['items']; |
68 | 68 | |
69 | 69 | return 0; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | $I |
73 | 73 | ->taskForEach() |
74 | 74 | ->deferTaskConfiguration('setIterable', 'items') |
75 | - ->withBuilder(function (CollectionBuilder $builder, $key, $value) use (&$actual) { |
|
76 | - $builder->addCode(function () use ($key, $value, &$actual) { |
|
75 | + ->withBuilder(function(CollectionBuilder $builder, $key, $value) use (&$actual) { |
|
76 | + $builder->addCode(function() use ($key, $value, &$actual) { |
|
77 | 77 | $actual[] = "$key = $value"; |
78 | 78 | |
79 | 79 | return 0; |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | $I->wantTo('call the __constructor() without argument'); |
92 | 92 | $I |
93 | 93 | ->taskForEach() |
94 | - ->withBuilder(function (CollectionBuilder $builder, $key, $value) use (&$actual) { |
|
95 | - $builder->addCode(function () use ($key, $value, &$actual) { |
|
94 | + ->withBuilder(function(CollectionBuilder $builder, $key, $value) use (&$actual) { |
|
95 | + $builder->addCode(function() use ($key, $value, &$actual) { |
|
96 | 96 | $actual++; |
97 | 97 | |
98 | 98 | return 0; |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | $relativePath = $this->convertNamespaceToPath($this->relativeNamespace); |
54 | 54 | |
55 | 55 | foreach ($this->classLoader->getPrefixesPsr4() as $baseNamespace => $directories) { |
56 | - $directories = array_filter(array_map(function ($directory) use ($relativePath) { |
|
57 | - return $directory.$relativePath; |
|
56 | + $directories = array_filter(array_map(function($directory) use ($relativePath) { |
|
57 | + return $directory . $relativePath; |
|
58 | 58 | }, $directories), 'is_dir'); |
59 | 59 | |
60 | 60 | if ($directories) { |
61 | 61 | foreach ($this->search($directories, $this->searchPattern) as $file) { |
62 | 62 | $relativePathName = $file->getRelativePathname(); |
63 | - $classes[] = $baseNamespace.$this->convertPathToNamespace($relativePath.'/'.$relativePathName); |
|
63 | + $classes[] = $baseNamespace . $this->convertPathToNamespace($relativePath . '/' . $relativePathName); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | } |
@@ -107,6 +107,6 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function convertNamespaceToPath($namespace) |
109 | 109 | { |
110 | - return '/'.str_replace("\\", '/', trim($namespace, '\\')); |
|
110 | + return '/' . str_replace("\\", '/', trim($namespace, '\\')); |
|
111 | 111 | } |
112 | 112 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | public function testGetClasses() |
12 | 12 | { |
13 | 13 | $classLoader = new ClassLoader(); |
14 | - $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__.'/../../plugins')]); |
|
14 | + $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__ . '/../../plugins')]); |
|
15 | 15 | $service = new RelativeNamespaceDiscovery($classLoader); |
16 | 16 | $service->setRelativeNamespace('Robo\Plugin'); |
17 | 17 | $service->setSearchPattern('*Commands.php'); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function testGetFile() |
26 | 26 | { |
27 | 27 | $classLoader = new ClassLoader(); |
28 | - $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__.'/../../plugins')]); |
|
28 | + $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__ . '/../../plugins')]); |
|
29 | 29 | $service = new RelativeNamespaceDiscovery($classLoader); |
30 | 30 | $service->setRelativeNamespace('Robo\Plugin'); |
31 | 31 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public function __construct($roboClass = null, $roboFile = null) |
64 | 64 | { |
65 | 65 | // set the const as class properties to allow overwriting in child classes |
66 | - $this->roboClass = $roboClass ? $roboClass : self::ROBOCLASS ; |
|
66 | + $this->roboClass = $roboClass ? $roboClass : self::ROBOCLASS; |
|
67 | 67 | $this->roboFile = $roboFile ? $roboFile : self::ROBOFILE; |
68 | 68 | $this->dir = getcwd(); |
69 | 69 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | { |
240 | 240 | /** @var \Robo\ClassDiscovery\RelativeNamespaceDiscovery $discovery */ |
241 | 241 | $discovery = Robo::service('relativeNamespaceDiscovery'); |
242 | - $discovery->setRelativeNamespace($relativeNamespace.'\Commands') |
|
242 | + $discovery->setRelativeNamespace($relativeNamespace . '\Commands') |
|
243 | 243 | ->setSearchPattern('*Commands.php'); |
244 | 244 | return $discovery->getClasses(); |
245 | 245 | } |
@@ -413,9 +413,9 @@ discard block |
||
413 | 413 | |
414 | 414 | if (substr($argv[$pos], 0, 12) == '--load-from=') { |
415 | 415 | $this->dir = substr($argv[$pos], 12); |
416 | - } elseif (isset($argv[$pos +1])) { |
|
417 | - $this->dir = $argv[$pos +1]; |
|
418 | - unset($argv[$pos +1]); |
|
416 | + } elseif (isset($argv[$pos + 1])) { |
|
417 | + $this->dir = $argv[$pos + 1]; |
|
418 | + unset($argv[$pos + 1]); |
|
419 | 419 | } |
420 | 420 | unset($argv[$pos]); |
421 | 421 | // Make adjustments if '--load-from' points at a file. |