Completed
Push — master ( 9226b3...e0bc2b )
by Mike
08:41
created
src/Element/Section/UpgradeChanges.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
     /**
83 83
      * Gets flav specific packages
84 84
      *
85
-     * @param $flav
86
-     * @param $packagesPath
85
+     * @param string $flav
86
+     * @param string $packagesPath
87 87
      *
88 88
      * @return array
89 89
      */
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
      * Calculates an array of possible upgrade chains
116 116
      *
117 117
      * @param $packages
118
-     * @param $buildVersion
119
-     * @param $upgradeTo
118
+     * @param string $buildVersion
119
+     * @param string $upgradeTo
120 120
      *
121 121
      * @return array
122 122
      */
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             return [];
73 73
         }
74 74
 
75
-        usort($chains, function ($a1, $a2) {
75
+        usort($chains, function($a1, $a2) {
76 76
             return count($a1) < count($a2) ? -1 : (count($a1) > count($a2) ? 1 : 0);
77 77
         });
78 78
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $versionMatrix = $this->getVersionMatrix($packages);
126 126
         $allVersions = array_keys($versionMatrix);
127 127
 
128
-        $getExistingSubversions = function ($version) use ($allVersions) {
128
+        $getExistingSubversions = function($version) use ($allVersions) {
129 129
             $existingVersions = [];
130 130
 
131 131
             $fromParts = explode('.', $version);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         };
141 141
 
142 142
         // init chains with starting versions
143
-        $chains = array_map(function ($version) use ($buildVersion) {
143
+        $chains = array_map(function($version) use ($buildVersion) {
144 144
             return [$version => $buildVersion];
145 145
         }, $getExistingSubversions($buildVersion));
146 146
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         }
151 151
 
152 152
         // gets last key of assoc array
153
-        $getLastKey = function ($array) {
153
+        $getLastKey = function($array) {
154 154
             end($array);
155 155
 
156 156
             return key($array);
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
             $chains = $fullChains;
200 200
         }
201 201
 
202
-        $chains = array_map(function ($chain) use ($versionMatrix) {
202
+        $chains = array_map(function($chain) use ($versionMatrix) {
203 203
             $keys = array_keys($chain);
204 204
             $values = array_values($chain);
205 205
 
@@ -229,17 +229,17 @@  discard block
 block discarded – undo
229 229
      */
230 230
     private function getVersionMatrix($packages)
231 231
     {
232
-        $allVersions = array_unique(call_user_func_array('array_merge', array_map(function ($package) {
232
+        $allVersions = array_unique(call_user_func_array('array_merge', array_map(function($package) {
233 233
             return [$package['from'], $package['to']];
234 234
         }, $packages)));
235 235
 
236 236
         // sort versions (ASC)
237
-        usort($allVersions, function ($v1, $v2) {
237
+        usort($allVersions, function($v1, $v2) {
238 238
             return version_compare($v1, $v2, '<') ? -1 : (version_compare($v1, $v2, '>') ? 1 : 0);
239 239
         });
240 240
 
241 241
         // create matrix and fill it with zeros
242
-        $versionMatrix = call_user_func_array('array_merge',array_map(function ($version) use ($allVersions) {
242
+        $versionMatrix = call_user_func_array('array_merge', array_map(function($version) use ($allVersions) {
243 243
             return [$version => array_combine($allVersions, array_fill(0, count($allVersions), 0))];
244 244
         }, $allVersions));
245 245
 
Please login to merge, or discard this patch.