Completed
Push — develop ( 0e25c3...d044f3 )
by Zack
16:03
created
vendor/phpdocumentor/type-resolver/src/PseudoTypes/Numeric_.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
 {
30 30
     public function __construct()
31 31
     {
32
-        AggregatedType::__construct([new NumericString(), new Integer(), new Float_()], '|');
32
+        AggregatedType::__construct( [ new NumericString(), new Integer(), new Float_() ], '|' );
33 33
     }
34 34
 
35 35
     public function underlyingType(): Type
36 36
     {
37
-        return new Compound([new NumericString(), new Integer(), new Float_()]);
37
+        return new Compound( [ new NumericString(), new Integer(), new Float_() ] );
38 38
     }
39 39
 
40 40
     /**
Please login to merge, or discard this patch.
vendor/phpdocumentor/type-resolver/src/PseudoTypes/IntegerRange.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     /** @var string */
31 31
     private $maxValue;
32 32
 
33
-    public function __construct(string $minValue, string $maxValue)
33
+    public function __construct( string $minValue, string $maxValue )
34 34
     {
35 35
         $this->minValue = $minValue;
36 36
         $this->maxValue = $maxValue;
Please login to merge, or discard this patch.
vendor/phpdocumentor/type-resolver/src/PseudoTypes/List_.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
         return new Array_();
32 32
     }
33 33
 
34
-    public function __construct(?Type $valueType = null)
34
+    public function __construct( ?Type $valueType = null )
35 35
     {
36
-        parent::__construct($valueType, new Integer());
36
+        parent::__construct( $valueType, new Integer() );
37 37
     }
38 38
 
39 39
     /**
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function __toString(): string
43 43
     {
44
-        if ($this->valueType instanceof Mixed_) {
44
+        if ( $this->valueType instanceof Mixed_ ) {
45 45
             return 'list';
46 46
         }
47 47
 
Please login to merge, or discard this patch.
vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 
55 55
     private static function getInstance() : InflectorObject
56 56
     {
57
-        if (self::$factory === null) {
57
+        if ( self::$factory === null ) {
58 58
             self::$factory = self::createFactory();
59 59
         }
60 60
 
61
-        if (self::$instance === null) {
61
+        if ( self::$instance === null ) {
62 62
             self::$instance = self::$factory->build();
63 63
         }
64 64
 
@@ -75,21 +75,21 @@  discard block
 block discarded – undo
75 75
      *
76 76
      * @deprecated
77 77
      */
78
-    public static function tableize(string $word) : string
78
+    public static function tableize( string $word ) : string
79 79
     {
80
-        @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
80
+        @trigger_error( sprintf( 'The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__ ), E_USER_DEPRECATED );
81 81
 
82
-        return self::getInstance()->tableize($word);
82
+        return self::getInstance()->tableize( $word );
83 83
     }
84 84
 
85 85
     /**
86 86
      * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'.
87 87
      */
88
-    public static function classify(string $word) : string
88
+    public static function classify( string $word ) : string
89 89
     {
90
-        @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
90
+        @trigger_error( sprintf( 'The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__ ), E_USER_DEPRECATED );
91 91
 
92
-        return self::getInstance()->classify($word);
92
+        return self::getInstance()->classify( $word );
93 93
     }
94 94
 
95 95
     /**
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
      *
98 98
      * @deprecated
99 99
      */
100
-    public static function camelize(string $word) : string
100
+    public static function camelize( string $word ) : string
101 101
     {
102
-        @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
102
+        @trigger_error( sprintf( 'The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__ ), E_USER_DEPRECATED );
103 103
 
104
-        return self::getInstance()->camelize($word);
104
+        return self::getInstance()->camelize( $word );
105 105
     }
106 106
 
107 107
     /**
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
      *
132 132
      * @deprecated
133 133
      */
134
-    public static function ucwords(string $string, string $delimiters = " \n\t\r\0\x0B-") : string
134
+    public static function ucwords( string $string, string $delimiters = " \n\t\r\0\x0B-" ) : string
135 135
     {
136
-        @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please use the "ucwords" function instead.', __METHOD__), E_USER_DEPRECATED);
136
+        @trigger_error( sprintf( 'The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please use the "ucwords" function instead.', __METHOD__ ), E_USER_DEPRECATED );
137 137
 
138
-        return ucwords($string, $delimiters);
138
+        return ucwords( $string, $delimiters );
139 139
     }
140 140
 
141 141
     /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public static function reset() : void
148 148
     {
149
-        @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
149
+        @trigger_error( sprintf( 'The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__ ), E_USER_DEPRECATED );
150 150
 
151 151
         self::$factory = null;
152 152
         self::$instance = null;
@@ -175,45 +175,45 @@  discard block
 block discarded – undo
175 175
      *
176 176
      * @deprecated
177 177
      */
178
-    public static function rules(string $type, iterable $rules, bool $reset = false) : void
178
+    public static function rules( string $type, iterable $rules, bool $reset = false ) : void
179 179
     {
180
-        @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
180
+        @trigger_error( sprintf( 'The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__ ), E_USER_DEPRECATED );
181 181
 
182
-        if (self::$factory === null) {
182
+        if ( self::$factory === null ) {
183 183
             self::$factory = self::createFactory();
184 184
         }
185 185
 
186 186
         self::$instance = null;
187 187
 
188
-        switch ($type) {
188
+        switch ( $type ) {
189 189
             case 'singular':
190
-                self::$factory->withSingularRules(self::buildRuleset($rules), $reset);
190
+                self::$factory->withSingularRules( self::buildRuleset( $rules ), $reset );
191 191
                 break;
192 192
             case 'plural':
193
-                self::$factory->withPluralRules(self::buildRuleset($rules), $reset);
193
+                self::$factory->withPluralRules( self::buildRuleset( $rules ), $reset );
194 194
                 break;
195 195
             default:
196
-                throw new InvalidArgumentException(sprintf('Cannot define custom inflection rules for type "%s".', $type));
196
+                throw new InvalidArgumentException( sprintf( 'Cannot define custom inflection rules for type "%s".', $type ) );
197 197
         }
198 198
     }
199 199
 
200 200
     /**
201 201
       * @param array<string,mixed>|iterable<string,mixed> $rules An array of rules to be added.
202 202
       */
203
-    private static function buildRuleset(iterable $rules) : Ruleset
203
+    private static function buildRuleset( iterable $rules ) : Ruleset
204 204
     {
205
-        $regular = [];
206
-        $irregular = [];
207
-        $uninflected = [];
205
+        $regular = [ ];
206
+        $irregular = [ ];
207
+        $uninflected = [ ];
208 208
 
209
-        foreach ($rules as $rule => $pattern) {
210
-            if ( ! is_array($pattern)) {
211
-                $regular[$rule] = $pattern;
209
+        foreach ( $rules as $rule => $pattern ) {
210
+            if ( ! is_array( $pattern ) ) {
211
+                $regular[ $rule ] = $pattern;
212 212
 
213 213
                 continue;
214 214
             }
215 215
 
216
-            switch ($rule) {
216
+            switch ( $rule ) {
217 217
                 case 'uninflected':
218 218
                     $uninflected = $pattern;
219 219
                     break;
@@ -227,26 +227,26 @@  discard block
 block discarded – undo
227 227
         }
228 228
 
229 229
         return new Ruleset(
230
-            new Transformations(...array_map(
231
-                static function (string $pattern, string $replacement) : Transformation {
232
-                    return new Transformation(new Pattern($pattern), $replacement);
230
+            new Transformations( ...array_map(
231
+                static function( string $pattern, string $replacement ) : Transformation {
232
+                    return new Transformation( new Pattern( $pattern ), $replacement );
233 233
                 },
234
-                array_keys($regular),
235
-                array_values($regular)
236
-            )),
237
-            new Patterns(...array_map(
238
-                static function (string $pattern) : Pattern {
239
-                    return new Pattern($pattern);
234
+                array_keys( $regular ),
235
+                array_values( $regular )
236
+            ) ),
237
+            new Patterns( ...array_map(
238
+                static function( string $pattern ) : Pattern {
239
+                    return new Pattern( $pattern );
240 240
                 },
241 241
                 $uninflected
242
-            )),
243
-            new Substitutions(...array_map(
244
-                static function (string $word, string $to) : Substitution {
245
-                    return new Substitution(new Word($word), new Word($to));
242
+            ) ),
243
+            new Substitutions( ...array_map(
244
+                static function( string $word, string $to ) : Substitution {
245
+                    return new Substitution( new Word( $word ), new Word( $to ) );
246 246
                 },
247
-                array_keys($irregular),
248
-                array_values($irregular)
249
-            ))
247
+                array_keys( $irregular ),
248
+                array_values( $irregular )
249
+            ) )
250 250
         );
251 251
     }
252 252
 
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
      *
260 260
      * @deprecated
261 261
      */
262
-    public static function pluralize(string $word) : string
262
+    public static function pluralize( string $word ) : string
263 263
     {
264
-        @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
264
+        @trigger_error( sprintf( 'The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__ ), E_USER_DEPRECATED );
265 265
 
266
-        return self::getInstance()->pluralize($word);
266
+        return self::getInstance()->pluralize( $word );
267 267
     }
268 268
 
269 269
     /**
@@ -275,10 +275,10 @@  discard block
 block discarded – undo
275 275
      *
276 276
      * @deprecated
277 277
      */
278
-    public static function singularize(string $word) : string
278
+    public static function singularize( string $word ) : string
279 279
     {
280
-        @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
280
+        @trigger_error( sprintf( 'The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__ ), E_USER_DEPRECATED );
281 281
 
282
-        return self::getInstance()->singularize($word);
282
+        return self::getInstance()->singularize( $word );
283 283
     }
284 284
 }
Please login to merge, or discard this patch.
vendor/composer/composer/src/Composer/DependencyResolver/PoolOptimizer.php 1 patch
Spacing   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     private $removedVersionsByPackage = array();
65 65
 
66
-    public function __construct(PolicyInterface $policy)
66
+    public function __construct( PolicyInterface $policy )
67 67
     {
68 68
         $this->policy = $policy;
69 69
     }
@@ -71,15 +71,15 @@  discard block
 block discarded – undo
71 71
     /**
72 72
      * @return Pool
73 73
      */
74
-    public function optimize(Request $request, Pool $pool)
74
+    public function optimize( Request $request, Pool $pool )
75 75
     {
76
-        $this->prepare($request, $pool);
76
+        $this->prepare( $request, $pool );
77 77
 
78
-        $this->optimizeByIdenticalDependencies($request, $pool);
78
+        $this->optimizeByIdenticalDependencies( $request, $pool );
79 79
 
80
-        $this->optimizeImpossiblePackagesAway($request, $pool);
80
+        $this->optimizeImpossiblePackagesAway( $request, $pool );
81 81
 
82
-        $optimizedPool = $this->applyRemovalsToPool($pool);
82
+        $optimizedPool = $this->applyRemovalsToPool( $pool );
83 83
 
84 84
         // No need to run this recursively at the moment
85 85
         // because the current optimizations cannot provide
@@ -99,55 +99,55 @@  discard block
 block discarded – undo
99 99
     /**
100 100
      * @return void
101 101
      */
102
-    private function prepare(Request $request, Pool $pool)
102
+    private function prepare( Request $request, Pool $pool )
103 103
     {
104 104
         $irremovablePackageConstraintGroups = array();
105 105
 
106 106
         // Mark fixed or locked packages as irremovable
107
-        foreach ($request->getFixedOrLockedPackages() as $package) {
108
-            $irremovablePackageConstraintGroups[$package->getName()][] = new Constraint('==', $package->getVersion());
107
+        foreach ( $request->getFixedOrLockedPackages() as $package ) {
108
+            $irremovablePackageConstraintGroups[ $package->getName() ][ ] = new Constraint( '==', $package->getVersion() );
109 109
         }
110 110
 
111 111
         // Extract requested package requirements
112
-        foreach ($request->getRequires() as $require => $constraint) {
113
-            $constraint = Intervals::compactConstraint($constraint);
114
-            $this->requireConstraintsPerPackage[$require][(string) $constraint] = $constraint;
112
+        foreach ( $request->getRequires() as $require => $constraint ) {
113
+            $constraint = Intervals::compactConstraint( $constraint );
114
+            $this->requireConstraintsPerPackage[ $require ][ (string)$constraint ] = $constraint;
115 115
         }
116 116
 
117 117
         // First pass over all packages to extract information and mark package constraints irremovable
118
-        foreach ($pool->getPackages() as $package) {
118
+        foreach ( $pool->getPackages() as $package ) {
119 119
             // Extract package requirements
120
-            foreach ($package->getRequires() as $link) {
121
-                $constraint = Intervals::compactConstraint($link->getConstraint());
122
-                $this->requireConstraintsPerPackage[$link->getTarget()][(string) $constraint] = $constraint;
120
+            foreach ( $package->getRequires() as $link ) {
121
+                $constraint = Intervals::compactConstraint( $link->getConstraint() );
122
+                $this->requireConstraintsPerPackage[ $link->getTarget() ][ (string)$constraint ] = $constraint;
123 123
             }
124 124
             // Extract package conflicts
125
-            foreach ($package->getConflicts() as $link) {
126
-                $constraint = Intervals::compactConstraint($link->getConstraint());
127
-                $this->conflictConstraintsPerPackage[$link->getTarget()][(string) $constraint] = $constraint;
125
+            foreach ( $package->getConflicts() as $link ) {
126
+                $constraint = Intervals::compactConstraint( $link->getConstraint() );
127
+                $this->conflictConstraintsPerPackage[ $link->getTarget() ][ (string)$constraint ] = $constraint;
128 128
             }
129 129
 
130 130
             // Keep track of alias packages for every package so if either the alias or aliased is kept
131 131
             // we keep the others as they are a unit of packages really
132
-            if ($package instanceof AliasPackage) {
133
-                $this->aliasesPerPackage[$package->getAliasOf()->id][] = $package;
132
+            if ( $package instanceof AliasPackage ) {
133
+                $this->aliasesPerPackage[ $package->getAliasOf()->id ][ ] = $package;
134 134
             }
135 135
         }
136 136
 
137 137
         $irremovablePackageConstraints = array();
138
-        foreach ($irremovablePackageConstraintGroups as $packageName => $constraints) {
139
-            $irremovablePackageConstraints[$packageName] = 1 === \count($constraints) ? $constraints[0] : new MultiConstraint($constraints, false);
138
+        foreach ( $irremovablePackageConstraintGroups as $packageName => $constraints ) {
139
+            $irremovablePackageConstraints[ $packageName ] = 1 === \count( $constraints ) ? $constraints[ 0 ] : new MultiConstraint( $constraints, false );
140 140
         }
141
-        unset($irremovablePackageConstraintGroups);
141
+        unset( $irremovablePackageConstraintGroups );
142 142
 
143 143
         // Mark the packages as irremovable based on the constraints
144
-        foreach ($pool->getPackages() as $package) {
145
-            if (!isset($irremovablePackageConstraints[$package->getName()])) {
144
+        foreach ( $pool->getPackages() as $package ) {
145
+            if ( ! isset( $irremovablePackageConstraints[ $package->getName() ] ) ) {
146 146
                 continue;
147 147
             }
148 148
 
149
-            if (CompilingMatcher::match($irremovablePackageConstraints[$package->getName()], Constraint::OP_EQ, $package->getVersion())) {
150
-                $this->markPackageIrremovable($package);
149
+            if ( CompilingMatcher::match( $irremovablePackageConstraints[ $package->getName() ], Constraint::OP_EQ, $package->getVersion() ) ) {
150
+                $this->markPackageIrremovable( $package );
151 151
             }
152 152
         }
153 153
     }
@@ -155,17 +155,17 @@  discard block
 block discarded – undo
155 155
     /**
156 156
      * @return void
157 157
      */
158
-    private function markPackageIrremovable(BasePackage $package)
158
+    private function markPackageIrremovable( BasePackage $package )
159 159
     {
160
-        $this->irremovablePackages[$package->id] = true;
161
-        if ($package instanceof AliasPackage) {
160
+        $this->irremovablePackages[ $package->id ] = true;
161
+        if ( $package instanceof AliasPackage ) {
162 162
             // recursing here so aliasesPerPackage for the aliasOf can be checked
163 163
             // and all its aliases marked as irremovable as well
164
-            $this->markPackageIrremovable($package->getAliasOf());
164
+            $this->markPackageIrremovable( $package->getAliasOf() );
165 165
         }
166
-        if (isset($this->aliasesPerPackage[$package->id])) {
167
-            foreach ($this->aliasesPerPackage[$package->id] as $aliasPackage) {
168
-                $this->irremovablePackages[$aliasPackage->id] = true;
166
+        if ( isset( $this->aliasesPerPackage[ $package->id ] ) ) {
167
+            foreach ( $this->aliasesPerPackage[ $package->id ] as $aliasPackage ) {
168
+                $this->irremovablePackages[ $aliasPackage->id ] = true;
169 169
             }
170 170
         }
171 171
     }
@@ -173,19 +173,19 @@  discard block
 block discarded – undo
173 173
     /**
174 174
      * @return Pool Optimized pool
175 175
      */
176
-    private function applyRemovalsToPool(Pool $pool)
176
+    private function applyRemovalsToPool( Pool $pool )
177 177
     {
178 178
         $packages = array();
179 179
         $removedVersions = array();
180
-        foreach ($pool->getPackages() as $package) {
181
-            if (!isset($this->packagesToRemove[$package->id])) {
182
-                $packages[] = $package;
180
+        foreach ( $pool->getPackages() as $package ) {
181
+            if ( ! isset( $this->packagesToRemove[ $package->id ] ) ) {
182
+                $packages[ ] = $package;
183 183
             } else {
184
-                $removedVersions[$package->getName()][$package->getVersion()] = $package->getPrettyVersion();
184
+                $removedVersions[ $package->getName() ][ $package->getVersion() ] = $package->getPrettyVersion();
185 185
             }
186 186
         }
187 187
 
188
-        $optimizedPool = new Pool($packages, $pool->getUnacceptableFixedOrLockedPackages(), $removedVersions, $this->removedVersionsByPackage);
188
+        $optimizedPool = new Pool( $packages, $pool->getUnacceptableFixedOrLockedPackages(), $removedVersions, $this->removedVersionsByPackage );
189 189
 
190 190
         return $optimizedPool;
191 191
     }
@@ -193,70 +193,70 @@  discard block
 block discarded – undo
193 193
     /**
194 194
      * @return void
195 195
      */
196
-    private function optimizeByIdenticalDependencies(Request $request, Pool $pool)
196
+    private function optimizeByIdenticalDependencies( Request $request, Pool $pool )
197 197
     {
198 198
         $identicalDefinitionsPerPackage = array();
199 199
         $packageIdenticalDefinitionLookup = array();
200 200
 
201
-        foreach ($pool->getPackages() as $package) {
201
+        foreach ( $pool->getPackages() as $package ) {
202 202
 
203 203
             // If that package was already marked irremovable, we can skip
204 204
             // the entire process for it
205
-            if (isset($this->irremovablePackages[$package->id])) {
205
+            if ( isset( $this->irremovablePackages[ $package->id ] ) ) {
206 206
                 continue;
207 207
             }
208 208
 
209
-            $this->markPackageForRemoval($package->id);
209
+            $this->markPackageForRemoval( $package->id );
210 210
 
211
-            $dependencyHash = $this->calculateDependencyHash($package);
211
+            $dependencyHash = $this->calculateDependencyHash( $package );
212 212
 
213
-            foreach ($package->getNames(false) as $packageName) {
213
+            foreach ( $package->getNames( false ) as $packageName ) {
214 214
 
215
-                if (!isset($this->requireConstraintsPerPackage[$packageName])) {
215
+                if ( ! isset( $this->requireConstraintsPerPackage[ $packageName ] ) ) {
216 216
                     continue;
217 217
                 }
218 218
 
219
-                foreach ($this->requireConstraintsPerPackage[$packageName] as $requireConstraint) {
219
+                foreach ( $this->requireConstraintsPerPackage[ $packageName ] as $requireConstraint ) {
220 220
                     $groupHashParts = array();
221 221
 
222
-                    if (CompilingMatcher::match($requireConstraint, Constraint::OP_EQ, $package->getVersion())) {
223
-                        $groupHashParts[] = 'require:' . (string) $requireConstraint;
222
+                    if ( CompilingMatcher::match( $requireConstraint, Constraint::OP_EQ, $package->getVersion() ) ) {
223
+                        $groupHashParts[ ] = 'require:' . (string)$requireConstraint;
224 224
                     }
225 225
 
226
-                    if ($package->getReplaces()) {
227
-                        foreach ($package->getReplaces() as $link) {
228
-                            if (CompilingMatcher::match($link->getConstraint(), Constraint::OP_EQ, $package->getVersion())) {
226
+                    if ( $package->getReplaces() ) {
227
+                        foreach ( $package->getReplaces() as $link ) {
228
+                            if ( CompilingMatcher::match( $link->getConstraint(), Constraint::OP_EQ, $package->getVersion() ) ) {
229 229
                                 // Use the same hash part as the regular require hash because that's what the replacement does
230
-                                $groupHashParts[] = 'require:' . (string) $link->getConstraint();
230
+                                $groupHashParts[ ] = 'require:' . (string)$link->getConstraint();
231 231
                             }
232 232
                         }
233 233
                     }
234 234
 
235
-                    if (isset($this->conflictConstraintsPerPackage[$packageName])) {
236
-                        foreach ($this->conflictConstraintsPerPackage[$packageName] as $conflictConstraint) {
237
-                            if (CompilingMatcher::match($conflictConstraint, Constraint::OP_EQ, $package->getVersion())) {
238
-                                $groupHashParts[] = 'conflict:' . (string) $conflictConstraint;
235
+                    if ( isset( $this->conflictConstraintsPerPackage[ $packageName ] ) ) {
236
+                        foreach ( $this->conflictConstraintsPerPackage[ $packageName ] as $conflictConstraint ) {
237
+                            if ( CompilingMatcher::match( $conflictConstraint, Constraint::OP_EQ, $package->getVersion() ) ) {
238
+                                $groupHashParts[ ] = 'conflict:' . (string)$conflictConstraint;
239 239
                             }
240 240
                         }
241 241
                     }
242 242
 
243
-                    if (!$groupHashParts) {
243
+                    if ( ! $groupHashParts ) {
244 244
                         continue;
245 245
                     }
246 246
 
247
-                    $groupHash = implode('', $groupHashParts);
248
-                    $identicalDefinitionsPerPackage[$packageName][$groupHash][$dependencyHash][] = $package;
249
-                    $packageIdenticalDefinitionLookup[$package->id][$packageName] = array('groupHash' => $groupHash, 'dependencyHash' => $dependencyHash);
247
+                    $groupHash = implode( '', $groupHashParts );
248
+                    $identicalDefinitionsPerPackage[ $packageName ][ $groupHash ][ $dependencyHash ][ ] = $package;
249
+                    $packageIdenticalDefinitionLookup[ $package->id ][ $packageName ] = array( 'groupHash' => $groupHash, 'dependencyHash' => $dependencyHash );
250 250
                 }
251 251
             }
252 252
         }
253 253
 
254
-        foreach ($identicalDefinitionsPerPackage as $constraintGroups) {
255
-            foreach ($constraintGroups as $constraintGroup) {
256
-                foreach ($constraintGroup as $packages) {
254
+        foreach ( $identicalDefinitionsPerPackage as $constraintGroups ) {
255
+            foreach ( $constraintGroups as $constraintGroup ) {
256
+                foreach ( $constraintGroup as $packages ) {
257 257
                     // Only one package in this constraint group has the same requirements, we're not allowed to remove that package
258
-                    if (1 === \count($packages)) {
259
-                        $this->keepPackage($packages[0], $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup);
258
+                    if ( 1 === \count( $packages ) ) {
259
+                        $this->keepPackage( $packages[ 0 ], $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup );
260 260
                         continue;
261 261
                     }
262 262
 
@@ -264,12 +264,12 @@  discard block
 block discarded – undo
264 264
                     // then not allowed to be removed either
265 265
                     $literals = array();
266 266
 
267
-                    foreach ($packages as $package) {
268
-                        $literals[] = $package->id;
267
+                    foreach ( $packages as $package ) {
268
+                        $literals[ ] = $package->id;
269 269
                     }
270 270
 
271
-                    foreach ($this->policy->selectPreferredPackages($pool, $literals) as $preferredLiteral) {
272
-                        $this->keepPackage($pool->literalToPackage($preferredLiteral), $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup);
271
+                    foreach ( $this->policy->selectPreferredPackages( $pool, $literals ) as $preferredLiteral ) {
272
+                        $this->keepPackage( $pool->literalToPackage( $preferredLiteral ), $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup );
273 273
                     }
274 274
                 }
275 275
             }
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     /**
280 280
      * @return string
281 281
      */
282
-    private function calculateDependencyHash(BasePackage $package)
282
+    private function calculateDependencyHash( BasePackage $package )
283 283
     {
284 284
         $hash = '';
285 285
 
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
             'provides' => $package->getProvides()
291 291
         );
292 292
 
293
-        foreach ($hashRelevantLinks as $key => $links) {
294
-            if (0 === \count($links)) {
293
+        foreach ( $hashRelevantLinks as $key => $links ) {
294
+            if ( 0 === \count( $links ) ) {
295 295
                 continue;
296 296
             }
297 297
 
@@ -300,18 +300,18 @@  discard block
 block discarded – undo
300 300
 
301 301
             $subhash = array();
302 302
 
303
-            foreach ($links as $link) {
303
+            foreach ( $links as $link ) {
304 304
                 // To get the best dependency hash matches we should use Intervals::compactConstraint() here.
305 305
                 // However, the majority of projects are going to specify their constraints already pretty
306 306
                 // much in the best variant possible. In other words, we'd be wasting time here and it would actually hurt
307 307
                 // performance more than the additional few packages that could be filtered out would benefit the process.
308
-                $subhash[$link->getTarget()] = (string) $link->getConstraint();
308
+                $subhash[ $link->getTarget() ] = (string)$link->getConstraint();
309 309
             }
310 310
 
311 311
             // Sort for best result
312
-            ksort($subhash);
312
+            ksort( $subhash );
313 313
 
314
-            foreach ($subhash as $target => $constraint) {
314
+            foreach ( $subhash as $target => $constraint ) {
315 315
                 $hash .= $target . '@' . $constraint;
316 316
             }
317 317
         }
@@ -323,14 +323,14 @@  discard block
 block discarded – undo
323 323
      * @param int $id
324 324
      * @return void
325 325
      */
326
-    private function markPackageForRemoval($id)
326
+    private function markPackageForRemoval( $id )
327 327
     {
328 328
         // We are not allowed to remove packages if they have been marked as irremovable
329
-        if (isset($this->irremovablePackages[$id])) {
330
-            throw new \LogicException('Attempted removing a package which was previously marked irremovable');
329
+        if ( isset( $this->irremovablePackages[ $id ] ) ) {
330
+            throw new \LogicException( 'Attempted removing a package which was previously marked irremovable' );
331 331
         }
332 332
 
333
-        $this->packagesToRemove[$id] = true;
333
+        $this->packagesToRemove[ $id ] = true;
334 334
     }
335 335
 
336 336
     /**
@@ -338,44 +338,44 @@  discard block
 block discarded – undo
338 338
      * @param array<int, array<string, array{groupHash: string, dependencyHash: string}>> $packageIdenticalDefinitionLookup
339 339
      * @return void
340 340
      */
341
-    private function keepPackage(BasePackage $package, $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup)
341
+    private function keepPackage( BasePackage $package, $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup )
342 342
     {
343
-        unset($this->packagesToRemove[$package->id]);
343
+        unset( $this->packagesToRemove[ $package->id ] );
344 344
 
345
-        if ($package instanceof AliasPackage) {
345
+        if ( $package instanceof AliasPackage ) {
346 346
             // recursing here so aliasesPerPackage for the aliasOf can be checked
347 347
             // and all its aliases marked to be kept as well
348
-            $this->keepPackage($package->getAliasOf(), $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup);
348
+            $this->keepPackage( $package->getAliasOf(), $identicalDefinitionsPerPackage, $packageIdenticalDefinitionLookup );
349 349
         }
350 350
 
351 351
         // record all the versions of the package group so we can list them later in Problem output
352
-        foreach ($package->getNames(false) as $name) {
353
-            if (isset($packageIdenticalDefinitionLookup[$package->id][$name])) {
354
-                $packageGroupPointers = $packageIdenticalDefinitionLookup[$package->id][$name];
355
-                $packageGroup = $identicalDefinitionsPerPackage[$name][$packageGroupPointers['groupHash']][$packageGroupPointers['dependencyHash']];
356
-                foreach ($packageGroup as $pkg) {
357
-                    if ($pkg instanceof AliasPackage && $pkg->getPrettyVersion() === VersionParser::DEFAULT_BRANCH_ALIAS) {
352
+        foreach ( $package->getNames( false ) as $name ) {
353
+            if ( isset( $packageIdenticalDefinitionLookup[ $package->id ][ $name ] ) ) {
354
+                $packageGroupPointers = $packageIdenticalDefinitionLookup[ $package->id ][ $name ];
355
+                $packageGroup = $identicalDefinitionsPerPackage[ $name ][ $packageGroupPointers[ 'groupHash' ] ][ $packageGroupPointers[ 'dependencyHash' ] ];
356
+                foreach ( $packageGroup as $pkg ) {
357
+                    if ( $pkg instanceof AliasPackage && $pkg->getPrettyVersion() === VersionParser::DEFAULT_BRANCH_ALIAS ) {
358 358
                         $pkg = $pkg->getAliasOf();
359 359
                     }
360
-                    $this->removedVersionsByPackage[spl_object_hash($package)][$pkg->getVersion()] = $pkg->getPrettyVersion();
360
+                    $this->removedVersionsByPackage[ spl_object_hash( $package ) ][ $pkg->getVersion() ] = $pkg->getPrettyVersion();
361 361
                 }
362 362
             }
363 363
         }
364 364
 
365
-        if (isset($this->aliasesPerPackage[$package->id])) {
366
-            foreach ($this->aliasesPerPackage[$package->id] as $aliasPackage) {
367
-                unset($this->packagesToRemove[$aliasPackage->id]);
365
+        if ( isset( $this->aliasesPerPackage[ $package->id ] ) ) {
366
+            foreach ( $this->aliasesPerPackage[ $package->id ] as $aliasPackage ) {
367
+                unset( $this->packagesToRemove[ $aliasPackage->id ] );
368 368
 
369 369
                 // record all the versions of the package group so we can list them later in Problem output
370
-                foreach ($aliasPackage->getNames(false) as $name) {
371
-                    if (isset($packageIdenticalDefinitionLookup[$aliasPackage->id][$name])) {
372
-                        $packageGroupPointers = $packageIdenticalDefinitionLookup[$aliasPackage->id][$name];
373
-                        $packageGroup = $identicalDefinitionsPerPackage[$name][$packageGroupPointers['groupHash']][$packageGroupPointers['dependencyHash']];
374
-                        foreach ($packageGroup as $pkg) {
375
-                            if ($pkg instanceof AliasPackage && $pkg->getPrettyVersion() === VersionParser::DEFAULT_BRANCH_ALIAS) {
370
+                foreach ( $aliasPackage->getNames( false ) as $name ) {
371
+                    if ( isset( $packageIdenticalDefinitionLookup[ $aliasPackage->id ][ $name ] ) ) {
372
+                        $packageGroupPointers = $packageIdenticalDefinitionLookup[ $aliasPackage->id ][ $name ];
373
+                        $packageGroup = $identicalDefinitionsPerPackage[ $name ][ $packageGroupPointers[ 'groupHash' ] ][ $packageGroupPointers[ 'dependencyHash' ] ];
374
+                        foreach ( $packageGroup as $pkg ) {
375
+                            if ( $pkg instanceof AliasPackage && $pkg->getPrettyVersion() === VersionParser::DEFAULT_BRANCH_ALIAS ) {
376 376
                                 $pkg = $pkg->getAliasOf();
377 377
                             }
378
-                            $this->removedVersionsByPackage[spl_object_hash($aliasPackage)][$pkg->getVersion()] = $pkg->getPrettyVersion();
378
+                            $this->removedVersionsByPackage[ spl_object_hash( $aliasPackage ) ][ $pkg->getVersion() ] = $pkg->getPrettyVersion();
379 379
                         }
380 380
                     }
381 381
                 }
@@ -390,59 +390,59 @@  discard block
 block discarded – undo
390 390
      *
391 391
      * @return void
392 392
      */
393
-    private function optimizeImpossiblePackagesAway(Request $request, Pool $pool)
393
+    private function optimizeImpossiblePackagesAway( Request $request, Pool $pool )
394 394
     {
395
-        if (count($request->getLockedPackages()) === 0) {
395
+        if ( count( $request->getLockedPackages() ) === 0 ) {
396 396
             return;
397 397
         }
398 398
 
399 399
         $packageIndex = array();
400 400
 
401
-        foreach ($pool->getPackages() as $package) {
401
+        foreach ( $pool->getPackages() as $package ) {
402 402
             $id = $package->id;
403 403
 
404 404
             // Do not remove irremovable packages
405
-            if (isset($this->irremovablePackages[$id])) {
405
+            if ( isset( $this->irremovablePackages[ $id ] ) ) {
406 406
                 continue;
407 407
             }
408 408
             // Do not remove a package aliased by another package, nor aliases
409
-            if (isset($this->aliasesPerPackage[$id]) || $package instanceof AliasPackage) {
409
+            if ( isset( $this->aliasesPerPackage[ $id ] ) || $package instanceof AliasPackage ) {
410 410
                 continue;
411 411
             }
412 412
             // Do not remove locked packages
413
-            if ($request->isFixedPackage($package) || $request->isLockedPackage($package)) {
413
+            if ( $request->isFixedPackage( $package ) || $request->isLockedPackage( $package ) ) {
414 414
                 continue;
415 415
             }
416 416
 
417
-            $packageIndex[$package->getName()][$package->id] = $package;
417
+            $packageIndex[ $package->getName() ][ $package->id ] = $package;
418 418
         }
419 419
 
420
-        foreach ($request->getLockedPackages() as $package) {
420
+        foreach ( $request->getLockedPackages() as $package ) {
421 421
             // If this locked package is no longer required by root or anything in the pool, it may get uninstalled so do not apply its requirements
422 422
             // In a case where a requirement WERE to appear in the pool by a package that would not be used, it would've been unlocked and so not filtered still
423 423
             $isUnusedPackage = true;
424
-            foreach ($package->getNames(false) as $packageName) {
425
-                if (isset($this->requireConstraintsPerPackage[$packageName])) {
424
+            foreach ( $package->getNames( false ) as $packageName ) {
425
+                if ( isset( $this->requireConstraintsPerPackage[ $packageName ] ) ) {
426 426
                     $isUnusedPackage = false;
427 427
                     break;
428 428
                 }
429 429
             }
430 430
 
431
-            if ($isUnusedPackage) {
431
+            if ( $isUnusedPackage ) {
432 432
                 continue;
433 433
             }
434 434
 
435
-            foreach ($package->getRequires() as $link) {
435
+            foreach ( $package->getRequires() as $link ) {
436 436
                 $require = $link->getTarget();
437
-                if (!isset($packageIndex[$require])) {
437
+                if ( ! isset( $packageIndex[ $require ] ) ) {
438 438
                     continue;
439 439
                 }
440 440
 
441 441
                 $linkConstraint = $link->getConstraint();
442
-                foreach ($packageIndex[$require] as $id => $requiredPkg) {
443
-                    if (false === CompilingMatcher::match($linkConstraint, Constraint::OP_EQ, $requiredPkg->getVersion())) {
444
-                        $this->markPackageForRemoval($id);
445
-                        unset($packageIndex[$require][$id]);
442
+                foreach ( $packageIndex[ $require ] as $id => $requiredPkg ) {
443
+                    if ( false === CompilingMatcher::match( $linkConstraint, Constraint::OP_EQ, $requiredPkg->getVersion() ) ) {
444
+                        $this->markPackageForRemoval( $id );
445
+                        unset( $packageIndex[ $require ][ $id ] );
446 446
                     }
447 447
                 }
448 448
             }
Please login to merge, or discard this patch.
Filter/PlatformRequirementFilter/PlatformRequirementFilterInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,5 +8,5 @@
 block discarded – undo
8 8
      * @param string $req
9 9
      * @return bool
10 10
      */
11
-    public function isIgnored($req);
11
+    public function isIgnored( $req );
12 12
 }
Please login to merge, or discard this patch.
Filter/PlatformRequirementFilter/IgnoreNothingPlatformRequirementFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
      * @param string $req
9 9
      * @return false
10 10
      */
11
-    public function isIgnored($req)
11
+    public function isIgnored( $req )
12 12
     {
13 13
         return false;
14 14
     }
Please login to merge, or discard this patch.
Filter/PlatformRequirementFilter/IgnoreAllPlatformRequirementFilter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
      * @param string $req
11 11
      * @return bool
12 12
      */
13
-    public function isIgnored($req)
13
+    public function isIgnored( $req )
14 14
     {
15
-        return PlatformRepository::isPlatformPackage($req);
15
+        return PlatformRepository::isPlatformPackage( $req );
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
Filter/PlatformRequirementFilter/PlatformRequirementFilterFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,20 +9,20 @@
 block discarded – undo
9 9
      *
10 10
      * @return PlatformRequirementFilterInterface
11 11
      */
12
-    public static function fromBoolOrList($boolOrList)
12
+    public static function fromBoolOrList( $boolOrList )
13 13
     {
14
-        if (is_bool($boolOrList)) {
14
+        if ( is_bool( $boolOrList ) ) {
15 15
             return $boolOrList ? self::ignoreAll() : self::ignoreNothing();
16 16
         }
17 17
 
18
-        if (is_array($boolOrList)) {
19
-            return new IgnoreListPlatformRequirementFilter($boolOrList);
18
+        if ( is_array( $boolOrList ) ) {
19
+            return new IgnoreListPlatformRequirementFilter( $boolOrList );
20 20
         }
21 21
 
22 22
         throw new \InvalidArgumentException(
23 23
             sprintf(
24 24
                 'PlatformRequirementFilter: Unknown $boolOrList parameter %s. Please report at https://github.com/composer/composer/issues/new.',
25
-                gettype($boolOrList)
25
+                gettype( $boolOrList )
26 26
             )
27 27
         );
28 28
     }
Please login to merge, or discard this patch.