@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * @param $key |
|
| 26 | + * @param string $key |
|
| 27 | 27 | * |
| 28 | 28 | * @return bool |
| 29 | 29 | */ |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * @param $key |
|
| 40 | + * @param string $key |
|
| 41 | 41 | * @param null $default |
| 42 | 42 | * |
| 43 | 43 | * @return mixed |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | - * @param $key |
|
| 59 | + * @param string $key |
|
| 60 | 60 | * @param $value |
| 61 | 61 | * @param null $ttl |
| 62 | 62 | * |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | /** |
| 69 | 69 | * Gets data from memory by key. |
| 70 | 70 | * |
| 71 | - * @param $key |
|
| 71 | + * @param string $key |
|
| 72 | 72 | * @param null $default |
| 73 | 73 | * |
| 74 | 74 | * @return mixed|null |
@@ -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 | } |
@@ -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 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // sort versions (ASC) |
| 76 | - usort($versions, function ($v1, $v2) { |
|
| 76 | + usort($versions, function($v1, $v2) { |
|
| 77 | 77 | return version_compare($v1, $v2, '<') ? -1 : (version_compare($v1, $v2, '>') ? 1 : 0); |
| 78 | 78 | }); |
| 79 | 79 | |
@@ -90,13 +90,13 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function getReleaseNotes($flav, array $versions) |
| 92 | 92 | { |
| 93 | - $newVersions = array_filter($versions, function ($version) use ($flav) { |
|
| 93 | + $newVersions = array_filter($versions, function($version) use ($flav) { |
|
| 94 | 94 | return !$this->cache->has($this->getCacheKey([$flav, 'release_notes', $version])); |
| 95 | 95 | }); |
| 96 | 96 | |
| 97 | - $requests = function () use ($flav, $newVersions) { |
|
| 97 | + $requests = function() use ($flav, $newVersions) { |
|
| 98 | 98 | foreach ($newVersions as $version) { |
| 99 | - yield $version => function () use ($flav, $version) { |
|
| 99 | + yield $version => function() use ($flav, $version) { |
|
| 100 | 100 | return $this->httpClient->getAsync($this->getReleaseNotesUri($flav, $version)); |
| 101 | 101 | }; |
| 102 | 102 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | if ($newVersions) { |
| 106 | 106 | $this->processRequestPool($requests, [ |
| 107 | - 'fulfilled' => function (ResponseInterface $response, $version) use ($flav) { |
|
| 107 | + 'fulfilled' => function(ResponseInterface $response, $version) use ($flav) { |
|
| 108 | 108 | $html = $response->getBody()->getContents(); |
| 109 | 109 | $crawler = new Crawler($this->purifyHtml($html, $this->getReleaseNotesUri($flav, $version))); |
| 110 | 110 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | $this->cache->set($this->getCacheKey([$flav, 'release_notes', $version]), $releaseNote); |
| 136 | 136 | }, |
| 137 | - 'rejected' => function ($reason, $version) { |
|
| 137 | + 'rejected' => function($reason, $version) { |
|
| 138 | 138 | throw new \RuntimeException( |
| 139 | 139 | sprintf('Can\'t get release notes for version: %s (reason: %s)', $version, $reason) |
| 140 | 140 | ); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - uksort($releaseNotes, function ($v1, $v2) { |
|
| 153 | + uksort($releaseNotes, function($v1, $v2) { |
|
| 154 | 154 | return version_compare($v1, $v2, '<') ? -1 : (version_compare($v1, $v2, '>') ? 1 : 0); |
| 155 | 155 | }); |
| 156 | 156 | |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | { |
| 320 | 320 | $delimiter = '___'; |
| 321 | 321 | |
| 322 | - return implode($delimiter, array_map(function ($key) { |
|
| 322 | + return implode($delimiter, array_map(function($key) { |
|
| 323 | 323 | return preg_replace('/[^a-zA-Z0-9_\.]+/', '', mb_strtolower($key)); |
| 324 | 324 | }, $keyParts)); |
| 325 | 325 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | /** |
| 224 | 224 | * Returns the result (response body) of GET request. |
| 225 | 225 | * |
| 226 | - * @param $url |
|
| 226 | + * @param string $url |
|
| 227 | 227 | * |
| 228 | 228 | * @return string |
| 229 | 229 | */ |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
| 238 | - * @param $version |
|
| 238 | + * @param string $version |
|
| 239 | 239 | * |
| 240 | 240 | * @return string |
| 241 | 241 | */ |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
| 248 | - * @param $version |
|
| 248 | + * @param string $version |
|
| 249 | 249 | * |
| 250 | 250 | * @return string |
| 251 | 251 | */ |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | /** |
| 330 | 330 | * Lightweight HTML purifier. |
| 331 | 331 | * |
| 332 | - * @param $html |
|
| 332 | + * @param string $html |
|
| 333 | 333 | * @param string $url |
| 334 | 334 | * @param array $options |
| 335 | 335 | * |
@@ -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) { |
@@ -4,5 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface RendererAwareInterface |
| 6 | 6 | { |
| 7 | + /** |
|
| 8 | + * @return void |
|
| 9 | + */ |
|
| 7 | 10 | public function setRenderer(RendererInterface $renderer); |
| 8 | 11 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function getSuitableElements(Context $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 | |