@@ -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 | * |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * |
44 | 44 | * Examples: 7.6.1 -> 7.6.1.0, 7.7 -> 7.7.1, 7.8 -> 7.8.0.0 |
45 | 45 | * |
46 | - * @param $flav |
|
46 | + * @param string $flav |
|
47 | 47 | * @param null $baseVersion |
48 | 48 | * |
49 | 49 | * @return mixed |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | /** |
100 | 100 | * Gets all required information to perform health check. |
101 | 101 | * |
102 | - * @param $version |
|
102 | + * @param string $version |
|
103 | 103 | * |
104 | 104 | * @return mixed |
105 | 105 | */ |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | /** |
112 | 112 | * Gets all required information to perform upgrade. |
113 | 113 | * |
114 | - * @param $version |
|
114 | + * @param string $version |
|
115 | 115 | * |
116 | 116 | * @return mixed |
117 | 117 | */ |
@@ -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 |
@@ -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 | } |
@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | /** |
55 | 55 | * Get all available SugarCRM versions (sorted ASC). |
56 | 56 | * |
57 | - * @param mixed $flav |
|
58 | - * @param mixed $pathToUpgradePackage |
|
57 | + * @param Context $pathToUpgradePackage |
|
59 | 58 | * |
60 | 59 | * @return mixed |
61 | 60 | */ |
@@ -75,7 +74,7 @@ discard block |
||
75 | 74 | * |
76 | 75 | * @param string $pathToUpgradePackage |
77 | 76 | * |
78 | - * @return mixed |
|
77 | + * @return string |
|
79 | 78 | */ |
80 | 79 | public function getListOfDeletedFiles($pathToUpgradePackage) |
81 | 80 | { |
@@ -87,7 +86,7 @@ discard block |
||
87 | 86 | * |
88 | 87 | * @param string $pathToUpgradePackage |
89 | 88 | * |
90 | - * @return mixed |
|
89 | + * @return string |
|
91 | 90 | */ |
92 | 91 | public function getListOfModifiedFiles($pathToUpgradePackage) |
93 | 92 | { |
@@ -99,7 +98,7 @@ discard block |
||
99 | 98 | * |
100 | 99 | * @param string $pathToUpgradePackage |
101 | 100 | * |
102 | - * @return mixed |
|
101 | + * @return string |
|
103 | 102 | */ |
104 | 103 | public function getListOfScripts($pathToUpgradePackage) |
105 | 104 | { |
@@ -111,7 +110,7 @@ discard block |
||
111 | 110 | * |
112 | 111 | * @param string $pathToUpgradePackage |
113 | 112 | * |
114 | - * @return mixed |
|
113 | + * @return string |
|
115 | 114 | */ |
116 | 115 | public function getListOfSQLScripts($pathToUpgradePackage) |
117 | 116 | { |
@@ -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 |
@@ -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 | */ |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | * |
316 | 316 | * @param $keyParts |
317 | 317 | * |
318 | - * @return mixed |
|
318 | + * @return string |
|
319 | 319 | */ |
320 | 320 | private function getCacheKey(array $keyParts) |
321 | 321 | { |
@@ -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 | } |