@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | $started = time(); |
35 | 35 | |
36 | - while(true) |
|
36 | + while (true) |
|
37 | 37 | { |
38 | 38 | if (!$this->storageDriver->exists($lockFileName)) |
39 | 39 | { |
@@ -106,12 +106,10 @@ discard block |
||
106 | 106 | if (is_string($token)) |
107 | 107 | { |
108 | 108 | $output .= $token; |
109 | - } |
|
110 | - elseif (in_array($token[0], [T_COMMENT, T_DOC_COMMENT])) |
|
109 | + } elseif (in_array($token[0], [T_COMMENT, T_DOC_COMMENT])) |
|
111 | 110 | { |
112 | 111 | $output .= str_repeat("\n", substr_count($token[1], "\n")); |
113 | - } |
|
114 | - elseif (T_WHITESPACE === $token[0]) |
|
112 | + } elseif (T_WHITESPACE === $token[0]) |
|
115 | 113 | { |
116 | 114 | // reduce wide spaces |
117 | 115 | $whitespace = preg_replace('{[ \t]+}', ' ', $token[1]); |
@@ -123,8 +121,7 @@ discard block |
||
123 | 121 | $whitespace = preg_replace('{\n +}', "\n", $whitespace); |
124 | 122 | |
125 | 123 | $output .= $whitespace; |
126 | - } |
|
127 | - else |
|
124 | + } else |
|
128 | 125 | { |
129 | 126 | $output .= $token[1]; |
130 | 127 | } |
@@ -59,8 +59,7 @@ |
||
59 | 59 | if ($input->getOption('config')) |
60 | 60 | { |
61 | 61 | $config = $reader->getConfiguration($input->getOption('config')); |
62 | - } |
|
63 | - elseif (is_file('archivr.json')) |
|
62 | + } elseif (is_file('archivr.json')) |
|
64 | 63 | { |
65 | 64 | $config = $reader->getConfiguration('archivr.json'); |
66 | 65 | } |
@@ -53,16 +53,13 @@ discard block |
||
53 | 53 | if (is_string($factory)) |
54 | 54 | { |
55 | 55 | $instance = new $factory(...$params); |
56 | - } |
|
57 | - elseif ($factory instanceof \Closure) |
|
56 | + } elseif ($factory instanceof \Closure) |
|
58 | 57 | { |
59 | 58 | $instance = $factory(...$params); |
60 | - } |
|
61 | - elseif (is_object($factory)) |
|
59 | + } elseif (is_object($factory)) |
|
62 | 60 | { |
63 | 61 | $instance = $factory; |
64 | - } |
|
65 | - else |
|
62 | + } else |
|
66 | 63 | { |
67 | 64 | throw new \LogicException(); |
68 | 65 | } |
@@ -101,12 +98,10 @@ discard block |
||
101 | 98 | { |
102 | 99 | throw new \RuntimeException(sprintf('Trying to register factory named "%s" to "%s" as class name "%s" which does not exist.', $name, static::class, $factory)); |
103 | 100 | } |
104 | - } |
|
105 | - elseif ($factory instanceof \Closure) |
|
101 | + } elseif ($factory instanceof \Closure) |
|
106 | 102 | { |
107 | 103 | // cannot really validate |
108 | - } |
|
109 | - elseif (is_object($factory)) |
|
104 | + } elseif (is_object($factory)) |
|
110 | 105 | { |
111 | 106 | if ($type = static::requiresInstanceOf()) |
112 | 107 | { |
@@ -115,8 +110,7 @@ discard block |
||
115 | 110 | throw new \RuntimeException(sprintf('Trying to register service instance named "%s" to "%s" as which is not an instance of "%s".', $name, static::class, $type)); |
116 | 111 | } |
117 | 112 | } |
118 | - } |
|
119 | - else |
|
113 | + } else |
|
120 | 114 | { |
121 | 115 | throw new \InvalidArgumentException(sprintf('Invalid factory of type "%s" named "%s" given to "%s".', gettype($factory), $name, static::class)); |
122 | 116 | } |
@@ -46,8 +46,7 @@ discard block |
||
46 | 46 | if ('..' == $part) |
47 | 47 | { |
48 | 48 | array_pop($absolutePathParts); |
49 | - } |
|
50 | - else |
|
49 | + } else |
|
51 | 50 | { |
52 | 51 | $absolutePathParts[] = $part; |
53 | 52 | } |
@@ -58,8 +57,7 @@ discard block |
||
58 | 57 | if (substr($path, 0, 1) === '/') |
59 | 58 | { |
60 | 59 | return '/' . $return; |
61 | - } |
|
62 | - else |
|
60 | + } else |
|
63 | 61 | { |
64 | 62 | return getcwd() . '/' . $return; |
65 | 63 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | |
74 | 74 | $configuration->addVault($vaultConfig); |
75 | 75 | } |
76 | - while($this->outputStyle->choice('Add another vault?', ['y', 'n'], 'n') === 'y'); |
|
76 | + while ($this->outputStyle->choice('Add another vault?', ['y', 'n'], 'n') === 'y'); |
|
77 | 77 | |
78 | 78 | |
79 | 79 | $skipDefaults = !$input->getOption('writeDefaults'); |
@@ -88,8 +88,7 @@ |
||
88 | 88 | $configurationFileWriter->writeConfigurationFile($configuration, $configFilePath, $skipDefaults); |
89 | 89 | |
90 | 90 | $output->writeln("<info>Successfully written config file to {$configFilePath}</info>"); |
91 | - } |
|
92 | - else |
|
91 | + } else |
|
93 | 92 | { |
94 | 93 | $output->writeln("<comment>Aborted</comment>"); |
95 | 94 | } |
@@ -41,8 +41,7 @@ |
||
41 | 41 | { |
42 | 42 | $vaultConfiguration->setConflictHandler('preferLocal'); |
43 | 43 | } |
44 | - } |
|
45 | - elseif ($preferRemote) |
|
44 | + } elseif ($preferRemote) |
|
46 | 45 | { |
47 | 46 | foreach ($configuration->getVaults() as $vaultConfiguration) |
48 | 47 | { |
@@ -200,8 +200,7 @@ |
||
200 | 200 | |
201 | 201 | $this->addVault($vaultConfig); |
202 | 202 | } |
203 | - } |
|
204 | - else |
|
203 | + } else |
|
205 | 204 | { |
206 | 205 | // using setter to prevent skipping validation |
207 | 206 | call_user_func([$this, 'set' . ucfirst($key)], $value); |
@@ -26,13 +26,11 @@ |
||
26 | 26 | { |
27 | 27 | $return[$key] = $recursiveDiff; |
28 | 28 | } |
29 | - } |
|
30 | - elseif ($value !== $array2[$key]) |
|
29 | + } elseif ($value !== $array2[$key]) |
|
31 | 30 | { |
32 | 31 | $return[$key] = $value; |
33 | 32 | } |
34 | - } |
|
35 | - else |
|
33 | + } else |
|
36 | 34 | { |
37 | 35 | $return[$key] = $value; |
38 | 36 | } |