@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $path = parse_url($base, PHP_URL_PATH); |
85 | 85 | $scheme = parse_url($base, PHP_URL_SCHEME); |
86 | 86 | |
87 | - return preg_replace_callback($pattern, function ($matches) use ($base, $scheme, $host, $path) { |
|
87 | + return preg_replace_callback($pattern, function($matches) use ($base, $scheme, $host, $path) { |
|
88 | 88 | $hrefValue = $matches[0]; |
89 | 89 | |
90 | 90 | if (mb_strpos($hrefValue, '//') === 0) { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | private function convertCode($content) |
150 | 150 | { |
151 | 151 | // strpos with array support |
152 | - $strposa = function ($haystack, $needles = []) { |
|
152 | + $strposa = function($haystack, $needles = []) { |
|
153 | 153 | $chr = []; |
154 | 154 | foreach ($needles as $needle) { |
155 | 155 | $res = mb_strpos($haystack, $needle); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | $content = str_replace(['<pre>', '<pre ', '</pre>'], ['<code>', '<code ', '</code>'], $content); |
169 | 169 | |
170 | - return preg_replace_callback('/<code(.*?)>(.*?)<\/code>/s', function ($matches) use ($strposa) { |
|
170 | + return preg_replace_callback('/<code(.*?)>(.*?)<\/code>/s', function($matches) use ($strposa) { |
|
171 | 171 | $noLineBreaks = str_replace(["\r\n", "\r", "\n"], '<br />', $matches[0]); |
172 | 172 | $code = str_replace(['<br></br>', '<br>', '<br/>', '<br />'], PHP_EOL, $noLineBreaks); |
173 | 173 |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $title = $this->formatter->asTitle(sprintf('SugarCRM upgrade: %s', $context)) . $delimiter; |
57 | 57 | |
58 | 58 | return $title . implode($delimiter, array_map( |
59 | - function ($element) use ($context) { |
|
59 | + function($element) use ($context) { |
|
60 | 60 | return $this->elementGenerator->generate($element, $context); |
61 | 61 | }, |
62 | 62 | $elements |
@@ -71,7 +71,7 @@ |
||
71 | 71 | * all versions with $baseVersion base |
72 | 72 | * for example: 7.6.1 -> [7.6.1.0, 7.6.1.1], 7.6 -> [7.6.1.0, 7.6.1.1, 7.6.2]. |
73 | 73 | */ |
74 | - $minors = array_filter($versions, function ($minor) use ($baseVersion) { |
|
74 | + $minors = array_filter($versions, function($minor) use ($baseVersion) { |
|
75 | 75 | return implode('.', array_slice(explode('.', $minor), 0, count(explode('.', $baseVersion)))) === $baseVersion; |
76 | 76 | }); |
77 | 77 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | public function getReleaseNotes($flav, array $versions) |
38 | 38 | { |
39 | - return array_map(function ($version) use ($flav) { |
|
39 | + return array_map(function($version) use ($flav) { |
|
40 | 40 | return $this->get(sprintf('%s_%s_release_notes', $flav, $version), ''); |
41 | 41 | }, $versions); |
42 | 42 | } |
@@ -3,8 +3,8 @@ |
||
3 | 3 | // application or vendor context |
4 | 4 | $autoload = [ |
5 | 5 | __DIR__ . '/../vendor/autoload.php', // application bin or phar |
6 | - __DIR__ . '/../autoload.php', // vendor bin |
|
7 | - __DIR__ . '/../../../autoload.php', // vendor |
|
6 | + __DIR__ . '/../autoload.php', // vendor bin |
|
7 | + __DIR__ . '/../../../autoload.php', // vendor |
|
8 | 8 | ]; |
9 | 9 | |
10 | 10 | foreach ($autoload as $file) { |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $providerChain = $container->findDefinition('data.provider_chain'); |
21 | 21 | |
22 | 22 | $taggedProviders = $container->findTaggedServiceIds('data.provider'); |
23 | - $providers = array_map(function ($id) { |
|
23 | + $providers = array_map(function($id) { |
|
24 | 24 | return new Reference($id); |
25 | 25 | }, array_keys($taggedProviders)); |
26 | 26 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $application = $container->findDefinition('application'); |
21 | 21 | |
22 | 22 | $taggedCommands = $container->findTaggedServiceIds('console.command'); |
23 | - $commands = array_map(function ($id) { |
|
23 | + $commands = array_map(function($id) { |
|
24 | 24 | return new Reference($id); |
25 | 25 | }, array_keys($taggedCommands)); |
26 | 26 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function getSuitableElements(Upgrade $context) |
52 | 52 | { |
53 | - $elements = array_filter($this->specElements, function (ElementInterface $element) use ($context) { |
|
53 | + $elements = array_filter($this->specElements, function(ElementInterface $element) use ($context) { |
|
54 | 54 | return $element->isRelevantTo($context); |
55 | 55 | }); |
56 | 56 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | // sort elements (ASC) |
66 | - usort($elements, function (ElementInterface $a, ElementInterface $b) { |
|
66 | + usort($elements, function(ElementInterface $a, ElementInterface $b) { |
|
67 | 67 | return $a->getOrder() > $b->getOrder() ? 1 : ($a->getOrder() < $b->getOrder() ? -1 : 0); |
68 | 68 | }); |
69 | 69 |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $deletedFiles = array_diff(array_merge($deletedFiles, $packageDeletedFiles), $packageModifiedFiles); |
78 | 78 | } |
79 | 79 | |
80 | - $modifiedFiles = array_keys(array_filter($modifiedFiles, function ($package, $changedFile) use ($buildPath, $packageZips) { |
|
80 | + $modifiedFiles = array_keys(array_filter($modifiedFiles, function($package, $changedFile) use ($buildPath, $packageZips) { |
|
81 | 81 | if (($buildFile = @file_get_contents($buildPath . DS . $changedFile)) === false) { |
82 | 82 | return false; |
83 | 83 | } |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | $zip->close(); |
93 | 93 | } |
94 | 94 | |
95 | - $modifiedFiles = array_values(array_filter($modifiedFiles, function ($file) use ($buildPath) { |
|
95 | + $modifiedFiles = array_values(array_filter($modifiedFiles, function($file) use ($buildPath) { |
|
96 | 96 | return file_exists($buildPath . '/custom/' . $file); |
97 | 97 | })); |
98 | 98 | |
99 | - $deletedFiles = array_values(array_filter($deletedFiles, function ($file) use ($buildPath) { |
|
99 | + $deletedFiles = array_values(array_filter($deletedFiles, function($file) use ($buildPath) { |
|
100 | 100 | return file_exists($buildPath . '/custom/' . $file); |
101 | 101 | })); |
102 | 102 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | return $this->suitablePackages; |
130 | 130 | } |
131 | 131 | |
132 | - usort($upgradeChains, function ($a1, $a2) { |
|
132 | + usort($upgradeChains, function($a1, $a2) { |
|
133 | 133 | return count($a1) < count($a2) ? -1 : (count($a1) > count($a2) ? 1 : 0); |
134 | 134 | }); |
135 | 135 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $versionMatrix = $this->getVersionMatrix($packages); |
212 | 212 | $allVersions = array_keys($versionMatrix); |
213 | 213 | |
214 | - $getExistingSubversions = function ($version) use ($allVersions) { |
|
214 | + $getExistingSubversions = function($version) use ($allVersions) { |
|
215 | 215 | $existingVersions = []; |
216 | 216 | |
217 | 217 | $fromParts = explode('.', $version); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | }; |
227 | 227 | |
228 | 228 | // init chains with starting versions |
229 | - $chains = array_map(function ($version) use ($buildVersion) { |
|
229 | + $chains = array_map(function($version) use ($buildVersion) { |
|
230 | 230 | return [$version => $buildVersion]; |
231 | 231 | }, $getExistingSubversions($buildVersion)); |
232 | 232 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | } |
237 | 237 | |
238 | 238 | // gets last key of assoc array |
239 | - $getLastKey = function ($array) { |
|
239 | + $getLastKey = function($array) { |
|
240 | 240 | end($array); |
241 | 241 | |
242 | 242 | return key($array); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $chains = $fullChains; |
286 | 286 | } |
287 | 287 | |
288 | - $chains = array_map(function ($chain) use ($versionMatrix) { |
|
288 | + $chains = array_map(function($chain) use ($versionMatrix) { |
|
289 | 289 | $keys = array_keys($chain); |
290 | 290 | $values = array_values($chain); |
291 | 291 | |
@@ -315,17 +315,17 @@ discard block |
||
315 | 315 | */ |
316 | 316 | private function getVersionMatrix($packages) |
317 | 317 | { |
318 | - $allVersions = array_unique(call_user_func_array('array_merge', array_map(function ($package) { |
|
318 | + $allVersions = array_unique(call_user_func_array('array_merge', array_map(function($package) { |
|
319 | 319 | return [$package['from'], $package['to']]; |
320 | 320 | }, $packages))); |
321 | 321 | |
322 | 322 | // sort versions (ASC) |
323 | - usort($allVersions, function ($v1, $v2) { |
|
323 | + usort($allVersions, function($v1, $v2) { |
|
324 | 324 | return version_compare($v1, $v2, '<') ? -1 : (version_compare($v1, $v2, '>') ? 1 : 0); |
325 | 325 | }); |
326 | 326 | |
327 | 327 | // create matrix and fill it with zeros |
328 | - $versionMatrix = call_user_func_array('array_merge',array_map(function ($version) use ($allVersions) { |
|
328 | + $versionMatrix = call_user_func_array('array_merge', array_map(function($version) use ($allVersions) { |
|
329 | 329 | return [$version => array_combine($allVersions, array_fill(0, count($allVersions), 0))]; |
330 | 330 | }, $allVersions)); |
331 | 331 |