@@ -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 Graph(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; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | /** |
135 | 135 | * @param Version $from |
136 | 136 | * |
137 | - * @return OrderedList |
|
137 | + * @return \Sugarcrm\UpgradeSpec\Version\OrderedList |
|
138 | 138 | */ |
139 | 139 | private function getOriginVertexes(Version $from) |
140 | 140 | { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | /** |
153 | 153 | * @param Version $to |
154 | 154 | * |
155 | - * @return OrderedList |
|
155 | + * @return \Sugarcrm\UpgradeSpec\Version\OrderedList |
|
156 | 156 | */ |
157 | 157 | private function getDestinationVertexes(Version $to) |
158 | 158 | { |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $aliases = $aliases->merge($from->getAliases()); |
145 | 145 | } |
146 | 146 | |
147 | - return $aliases->filter(function (Version $version) { |
|
147 | + return $aliases->filter(function(Version $version) { |
|
148 | 148 | return isset($this->graph[$version]); |
149 | 149 | }); |
150 | 150 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | private function getDestinationVertexes(Version $to) |
158 | 158 | { |
159 | - return $to->getAliases()->filter(function (Version $version) { |
|
159 | + return $to->getAliases()->filter(function(Version $version) { |
|
160 | 160 | return isset($this->graph[$version]); |
161 | 161 | }); |
162 | 162 | } |
@@ -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 |