@@ -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 |
@@ -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 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | // add parent edges |
| 35 | 35 | foreach ($versions as $version) { |
| 36 | - $minorVersions = $versions->filter(function (Version $minorVersion) use ($version) { |
|
| 36 | + $minorVersions = $versions->filter(function(Version $minorVersion) use ($version) { |
|
| 37 | 37 | return $minorVersion->isChildOf($version); |
| 38 | 38 | }); |
| 39 | 39 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | // sort versions (jASC) |
| 24 | - usort($this->versions, function (Version $v1, Version $v2) { |
|
| 24 | + usort($this->versions, function(Version $v1, Version $v2) { |
|
| 25 | 25 | $v1 = (string) $v1->getFull(); |
| 26 | 26 | $v2 = (string) $v2->getFull(); |
| 27 | 27 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function merge(OrderedList $range, $checkAliases = false) |
| 50 | 50 | { |
| 51 | - $filtered = $range->filter(function (Version $version) use ($checkAliases) { |
|
| 51 | + $filtered = $range->filter(function(Version $version) use ($checkAliases) { |
|
| 52 | 52 | return !$this->contains($version, $checkAliases); |
| 53 | 53 | }); |
| 54 | 54 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | public function contains(Version $version, $checkAliases = false) |
| 65 | 65 | { |
| 66 | 66 | if ($checkAliases) { |
| 67 | - return in_array($version->getFull(), $this->map(function (Version $version) { |
|
| 67 | + return in_array($version->getFull(), $this->map(function(Version $version) { |
|
| 68 | 68 | return $version->getFull(); |
| 69 | 69 | })); |
| 70 | 70 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | public function isEqualTo(OrderedList $range, $checkAliases = false) |
| 108 | 108 | { |
| 109 | 109 | if ($checkAliases) { |
| 110 | - $getFull = function (Version $version) { |
|
| 110 | + $getFull = function(Version $version) { |
|
| 111 | 111 | return $version->getFull(); |
| 112 | 112 | }; |
| 113 | 113 | |
@@ -88,13 +88,13 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function getReleaseNotes($flav, OrderedList $versions) |
| 90 | 90 | { |
| 91 | - $newVersions = $versions->filter(function (Version $version) use ($flav) { |
|
| 91 | + $newVersions = $versions->filter(function(Version $version) use ($flav) { |
|
| 92 | 92 | return !$this->cache->has($this->getCacheKey([$flav, 'release_notes', (string) $version])); |
| 93 | 93 | }); |
| 94 | 94 | |
| 95 | - $requests = function () use ($flav, $newVersions) { |
|
| 95 | + $requests = function() use ($flav, $newVersions) { |
|
| 96 | 96 | foreach ($newVersions as $version) { |
| 97 | - yield (string) $version => function () use ($flav, $version) { |
|
| 97 | + yield (string) $version => function() use ($flav, $version) { |
|
| 98 | 98 | return $this->httpClient->getAsync($this->getReleaseNotesUri($flav, $version)); |
| 99 | 99 | }; |
| 100 | 100 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | if (count($newVersions)) { |
| 104 | 104 | $this->processRequestPool($requests, [ |
| 105 | - 'fulfilled' => function (ResponseInterface $response, $version) use ($flav) { |
|
| 105 | + 'fulfilled' => function(ResponseInterface $response, $version) use ($flav) { |
|
| 106 | 106 | $html = $response->getBody()->getContents(); |
| 107 | 107 | $crawler = new Crawler($this->purifyHtml($html, $this->getReleaseNotesUri($flav, new Version($version)))); |
| 108 | 108 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | $this->cache->set($this->getCacheKey([$flav, 'release_notes', $version]), $releaseNote); |
| 134 | 134 | }, |
| 135 | - 'rejected' => function ($reason, $version) { |
|
| 135 | + 'rejected' => function($reason, $version) { |
|
| 136 | 136 | throw new \RuntimeException( |
| 137 | 137 | sprintf('Can\'t get release notes for version: %s (reason: %s)', $version, $reason) |
| 138 | 138 | ); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | { |
| 308 | 308 | $delimiter = '___'; |
| 309 | 309 | |
| 310 | - return implode($delimiter, array_map(function ($key) { |
|
| 310 | + return implode($delimiter, array_map(function($key) { |
|
| 311 | 311 | return preg_replace('/[^a-zA-Z0-9_\.]+/', '', mb_strtolower($key)); |
| 312 | 312 | }, $keyParts)); |
| 313 | 313 | } |