@@ -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 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $escapeChar = chr('27'); |
20 | 20 | $that = $this; |
21 | 21 | |
22 | - array_map(function ($filter) use (&$semanticGroups, $delimiter, $escapeChar, $that) { |
|
22 | + array_map(function($filter) use (&$semanticGroups, $delimiter, $escapeChar, $that) { |
|
23 | 23 | $escapedFilter = trim( |
24 | 24 | str_replace( |
25 | 25 | $escapeChar, |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | $that = $this; |
59 | 59 | |
60 | - return array_map(function ($filter) use ($that) { |
|
60 | + return array_map(function($filter) use ($that) { |
|
61 | 61 | return (!$that->isInvertedFilter($filter) ? FilterUtils::NEGATION_PREFIX : '') . |
62 | 62 | ltrim($filter, FilterUtils::NEGATION_PREFIX); |
63 | 63 | }, $filters); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | public function trimRules(array $filters) |
72 | 72 | { |
73 | - return array_map(function ($filter) { |
|
73 | + return array_map(function($filter) { |
|
74 | 74 | return ltrim($filter, FilterUtils::NEGATION_PREFIX); |
75 | 75 | }, $filters); |
76 | 76 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $result = array(); |
13 | 13 | |
14 | 14 | foreach ($patterns as $pattern) { |
15 | - preg_match_all('/' . sprintf($pattern, '([^\}]+)'). '/', $template, $usedVariables); |
|
15 | + preg_match_all('/' . sprintf($pattern, '([^\}]+)') . '/', $template, $usedVariables); |
|
16 | 16 | |
17 | 17 | foreach ($usedVariables[1] as $variableName) { |
18 | 18 | if (!preg_match_all('/\(([^\)]+)\)/', $variableName, $valueRules)) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $updateGroups[] = array_combine( |
74 | - array_map(function ($item) use ($format) { |
|
74 | + array_map(function($item) use ($format) { |
|
75 | 75 | return sprintf($format, $item); |
76 | 76 | }, array_keys($arguments)), |
77 | 77 | $templateArguments |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | $names = array_keys($variables); |
84 | 84 | |
85 | - $values = array_map(function ($value) { |
|
85 | + $values = array_map(function($value) { |
|
86 | 86 | return trim( |
87 | 87 | strtok($value, PHP_EOL) |
88 | 88 | ); |
@@ -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(); |