@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | private function expandPathVariables(array $pathVariables, array $mutationNamesMap) |
134 | 134 | { |
135 | - $normalizedVariables = array_map(function ($part) { |
|
135 | + $normalizedVariables = array_map(function($part) { |
|
136 | 136 | $part = strtolower( |
137 | 137 | preg_replace( |
138 | 138 | array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), |
@@ -184,19 +184,19 @@ discard block |
||
184 | 184 | private function createMutationAppliers() |
185 | 185 | { |
186 | 186 | return array( |
187 | - function ($value) { |
|
187 | + function($value) { |
|
188 | 188 | return str_replace(' ', '', $value); |
189 | 189 | }, |
190 | - function ($value) { |
|
190 | + function($value) { |
|
191 | 191 | return str_replace(' ', '', ucwords($value)); |
192 | 192 | }, |
193 | - function ($value) { |
|
193 | + function($value) { |
|
194 | 194 | return str_replace(' ', '', ucfirst($value)); |
195 | 195 | }, |
196 | - function ($value) { |
|
196 | + function($value) { |
|
197 | 197 | return str_replace(' ', '-', $value); |
198 | 198 | }, |
199 | - function ($value) { |
|
199 | + function($value) { |
|
200 | 200 | return str_replace(' ', '_', $value); |
201 | 201 | }, |
202 | 202 | ); |
@@ -35,8 +35,8 @@ |
||
35 | 35 | |
36 | 36 | public function updateStatuses(array $patches, $status) |
37 | 37 | { |
38 | - return array_map(function (array $group) use ($status) { |
|
39 | - return array_map(function (array $patch) use ($status) { |
|
38 | + return array_map(function(array $group) use ($status) { |
|
39 | + return array_map(function(array $patch) use ($status) { |
|
40 | 40 | return array_replace($patch, array( |
41 | 41 | Patch::STATUS => $status |
42 | 42 | )); |
@@ -68,9 +68,9 @@ |
||
68 | 68 | { |
69 | 69 | return array_reduce( |
70 | 70 | $patches, |
71 | - function (array $result, array $items) use ($keys) { |
|
71 | + function(array $result, array $items) use ($keys) { |
|
72 | 72 | $values = array_values( |
73 | - array_map(function ($item) use ($keys) { |
|
73 | + array_map(function($item) use ($keys) { |
|
74 | 74 | foreach ($keys as $key) { |
75 | 75 | if (!isset($item[$key])) { |
76 | 76 | continue; |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | return $this->patchListUtils->applyDefinitionFilter( |
66 | 66 | $patches, |
67 | - function ($patchData) use ($excludedPatches) { |
|
67 | + function($patchData) use ($excludedPatches) { |
|
68 | 68 | $owner = $patchData[PatchDefinition::OWNER]; |
69 | 69 | $source = $patchData[PatchDefinition::SOURCE]; |
70 | 70 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | return $this->patchListUtils->applyDefinitionFilter( |
43 | 43 | $patches, |
44 | - function ($patchData) use ($packageName) { |
|
44 | + function($patchData) use ($packageName) { |
|
45 | 45 | if (!$patchData[PatchDefinition::LOCAL]) { |
46 | 46 | return true; |
47 | 47 | } |
@@ -118,10 +118,10 @@ discard block |
||
118 | 118 | { |
119 | 119 | $pathFlags = array_fill_keys($this->getAllPaths($listB), true); |
120 | 120 | |
121 | - return array_map(function (array $group) use ($pathFlags) { |
|
121 | + return array_map(function(array $group) use ($pathFlags) { |
|
122 | 122 | return array_filter( |
123 | 123 | $group, |
124 | - function (array $item) use ($pathFlags) { |
|
124 | + function(array $item) use ($pathFlags) { |
|
125 | 125 | $path = $item[Patch::PATH] ? $item[Patch::PATH] : $item[Patch::URL]; |
126 | 126 | |
127 | 127 | return !isset($pathFlags[$path]); |
@@ -134,10 +134,10 @@ discard block |
||
134 | 134 | { |
135 | 135 | $pathFlags = array_fill_keys($this->getAllPaths($listB), true); |
136 | 136 | |
137 | - return array_map(function (array $group) use ($pathFlags) { |
|
137 | + return array_map(function(array $group) use ($pathFlags) { |
|
138 | 138 | return array_filter( |
139 | 139 | $group, |
140 | - function (array $item) use ($pathFlags) { |
|
140 | + function(array $item) use ($pathFlags) { |
|
141 | 141 | $path = $item[Patch::PATH] ? $item[Patch::PATH] : $item[Patch::URL]; |
142 | 142 | |
143 | 143 | return isset($pathFlags[$path]); |
@@ -178,11 +178,11 @@ discard block |
||
178 | 178 | { |
179 | 179 | return array_reduce( |
180 | 180 | $patches, |
181 | - function ($result, array $group) { |
|
181 | + function($result, array $group) { |
|
182 | 182 | return array_merge( |
183 | 183 | $result, |
184 | 184 | array_values( |
185 | - array_map(function (array $item) { |
|
185 | + array_map(function(array $item) { |
|
186 | 186 | return $item[Patch::PATH] ? $item[Patch::PATH] : $item[Patch::URL]; |
187 | 187 | }, $group) |
188 | 188 | ) |
@@ -211,7 +211,7 @@ |
||
211 | 211 | $patchListUpdater->updateStatuses($excludedPatches, 'excluded') |
212 | 212 | ); |
213 | 213 | |
214 | - array_walk($patches, function (array &$group) { |
|
214 | + array_walk($patches, function(array &$group) { |
|
215 | 215 | ksort($group); |
216 | 216 | }, $patches); |
217 | 217 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $repository = $composer->getRepositoryManager()->getLocalRepository(); |
194 | 194 | |
195 | 195 | $result = $runtimeUtils->executeWithPostAction( |
196 | - function () use ($shouldUndo, $filters, $bootstrap, $isDevMode) { |
|
196 | + function() use ($shouldUndo, $filters, $bootstrap, $isDevMode) { |
|
197 | 197 | if ($shouldUndo && !array_filter($filters)) { |
198 | 198 | $bootstrap->stripPatches($isDevMode); |
199 | 199 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | return $bootstrap->applyPatches($isDevMode); |
204 | 204 | }, |
205 | - function () use ($repository, $lockSanitizer) { |
|
205 | + function() use ($repository, $lockSanitizer) { |
|
206 | 206 | $repository->write(); |
207 | 207 | $lockSanitizer->sanitize(); |
208 | 208 | } |
@@ -94,10 +94,10 @@ |
||
94 | 94 | $runtimeUtils = new \Vaimo\ComposerPatches\Utils\RuntimeUtils(); |
95 | 95 | |
96 | 96 | $result = $runtimeUtils->executeWithPostAction( |
97 | - function () use ($bootstrap, $event) { |
|
97 | + function() use ($bootstrap, $event) { |
|
98 | 98 | return $bootstrap->applyPatches($event->isDevMode()); |
99 | 99 | }, |
100 | - function () use ($event, $lockSanitizer) { |
|
100 | + function() use ($event, $lockSanitizer) { |
|
101 | 101 | $repository = $event->getComposer()->getRepositoryManager()->getLocalRepository(); |
102 | 102 | |
103 | 103 | $repository->write(); |