@@ -7,8 +7,9 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * Renders template. |
| 9 | 9 | * |
| 10 | - * @param $name |
|
| 10 | + * @param string $name |
|
| 11 | 11 | * @param $arguments |
| 12 | + * @return string |
|
| 12 | 13 | */ |
| 13 | 14 | public function render($name, $arguments); |
| 14 | 15 | } |
@@ -6,13 +6,30 @@ |
||
| 6 | 6 | |
| 7 | 7 | interface AdapterInterface |
| 8 | 8 | { |
| 9 | + /** |
|
| 10 | + * @return boolean |
|
| 11 | + */ |
|
| 9 | 12 | public function hasUpdate(); |
| 10 | 13 | |
| 14 | + /** |
|
| 15 | + * @return string |
|
| 16 | + */ |
|
| 11 | 17 | public function getOldVersion(); |
| 12 | 18 | |
| 19 | + /** |
|
| 20 | + * @return string |
|
| 21 | + */ |
|
| 13 | 22 | public function getNewVersion(); |
| 14 | 23 | |
| 24 | + /** |
|
| 25 | + * @param string $stability |
|
| 26 | + * |
|
| 27 | + * @return boolean |
|
| 28 | + */ |
|
| 15 | 29 | public function update($stability = Updater::STABILITY_ANY); |
| 16 | 30 | |
| 31 | + /** |
|
| 32 | + * @return boolean |
|
| 33 | + */ |
|
| 17 | 34 | public function rollback(); |
| 18 | 35 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * @return mixed |
|
| 35 | + * @return string |
|
| 36 | 36 | */ |
| 37 | 37 | public function getOldVersion() |
| 38 | 38 | { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * @return mixed |
|
| 43 | + * @return string |
|
| 44 | 44 | */ |
| 45 | 45 | public function getNewVersion() |
| 46 | 46 | { |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | - * @param $stability |
|
| 78 | + * @param string $stability |
|
| 79 | 79 | * |
| 80 | 80 | * @return string |
| 81 | 81 | */ |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * @param Upgrade $context |
| 35 | 35 | * |
| 36 | - * @return bool |
|
| 36 | + * @return string |
|
| 37 | 37 | */ |
| 38 | 38 | public function isRelevantTo(Upgrade $context) |
| 39 | 39 | { |
@@ -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 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * @return Version |
|
| 32 | + * @return string |
|
| 33 | 33 | */ |
| 34 | 34 | public function getBuildVersion() |
| 35 | 35 | { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | - * @return Version |
|
| 56 | + * @return string |
|
| 57 | 57 | */ |
| 58 | 58 | public function getTargetVersion() |
| 59 | 59 | { |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | * |
| 127 | 127 | * @param Upgrade $context |
| 128 | 128 | * |
| 129 | - * @return mixed |
|
| 129 | + * @return Upgrade |
|
| 130 | 130 | */ |
| 131 | 131 | public function getPotentiallyBrokenCustomizations(Upgrade $context) |
| 132 | 132 | { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * all versions with $baseVersion base |
| 73 | 73 | * for example: 7.6.1 -> [7.6.1, 7.6.1.0, 7.6.1.1], 7.6 -> [7.6.1.0, 7.6.1.1, 7.6.2]. |
| 74 | 74 | */ |
| 75 | - $minors = $versions->filter(function (Version $version) use ($baseVersion) { |
|
| 75 | + $minors = $versions->filter(function(Version $version) use ($baseVersion) { |
|
| 76 | 76 | return $version->isChildOf($baseVersion) || $version->isEqualTo($baseVersion); |
| 77 | 77 | }); |
| 78 | 78 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $from = (string) $context->getBuildVersion()->getFull(); |
| 158 | 158 | $to = (string) $context->getTargetVersion()->getFull(); |
| 159 | 159 | |
| 160 | - return $this->getVersions($context->getBuildFlav())->filter(function (Version $version) use ($from, $to) { |
|
| 160 | + return $this->getVersions($context->getBuildFlav())->filter(function(Version $version) use ($from, $to) { |
|
| 161 | 161 | return version_compare((string) $version, $from, '>') |
| 162 | 162 | && version_compare((string) $version, $to, '<='); |
| 163 | 163 | }); |
@@ -315,7 +315,7 @@ |
||
| 315 | 315 | /** |
| 316 | 316 | * Lightweight HTML purifier. |
| 317 | 317 | * |
| 318 | - * @param $html |
|
| 318 | + * @param string $html |
|
| 319 | 319 | * @param string $url |
| 320 | 320 | * @param array $options |
| 321 | 321 | * |
@@ -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 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | - * @param $buildPath |
|
| 52 | + * @param string $buildPath |
|
| 53 | 53 | * @param $packages |
| 54 | 54 | * |
| 55 | 55 | * @return array |
@@ -140,8 +140,8 @@ discard block |
||
| 140 | 140 | /** |
| 141 | 141 | * Gets flav specific packages |
| 142 | 142 | * |
| 143 | - * @param $flav |
|
| 144 | - * @param $packagesPath |
|
| 143 | + * @param string $flav |
|
| 144 | + * @param string $packagesPath |
|
| 145 | 145 | * |
| 146 | 146 | * @return array |
| 147 | 147 | */ |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $deletedFiles = array_diff(array_merge($deletedFiles, $packageDeletedFiles), $packageModifiedFiles); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - $modifiedFiles = array_keys(array_filter($modifiedFiles, function ($package, $changedFile) use ($buildPath, $packageZips) { |
|
| 84 | + $modifiedFiles = array_keys(array_filter($modifiedFiles, function($package, $changedFile) use ($buildPath, $packageZips) { |
|
| 85 | 85 | if (($buildFile = @file_get_contents($buildPath . DS . $changedFile)) === false) { |
| 86 | 86 | return false; |
| 87 | 87 | } |
@@ -96,11 +96,11 @@ discard block |
||
| 96 | 96 | $zip->close(); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - $modifiedFiles = array_values(array_filter($modifiedFiles, function ($file) use ($buildPath) { |
|
| 99 | + $modifiedFiles = array_values(array_filter($modifiedFiles, function($file) use ($buildPath) { |
|
| 100 | 100 | return file_exists($buildPath . '/custom/' . $file); |
| 101 | 101 | })); |
| 102 | 102 | |
| 103 | - $deletedFiles = array_values(array_filter($deletedFiles, function ($file) use ($buildPath) { |
|
| 103 | + $deletedFiles = array_values(array_filter($deletedFiles, function($file) use ($buildPath) { |
|
| 104 | 104 | return file_exists($buildPath . '/custom/' . $file); |
| 105 | 105 | })); |
| 106 | 106 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $packages = $this->getFlavPackages($context->getBuildFlav(), $context->getTargetPath()); |
| 125 | 125 | $graph = new Dijkstra(new AdjacencyList($packages)); |
| 126 | 126 | |
| 127 | - $this->suitablePackages = array_map(function (array $hop) use ($packages) { |
|
| 127 | + $this->suitablePackages = array_map(function(array $hop) use ($packages) { |
|
| 128 | 128 | foreach ($packages as $path => $pair) { |
| 129 | 129 | if ((new OrderedList($hop))->isEqualTo(new OrderedList($pair))) { |
| 130 | 130 | return $path; |