-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Description
Just a heads-up: The latest dev version of PHPStan (soon to be released as 0.12.49) found a bug in InitCommand.php:
------ ------------------------------------------------------
Line src/Composer/Command/InitCommand.php
------ ------------------------------------------------------
460 Empty array passed to foreach.
463 Call to function unset() contains undefined variable
$requiredPackage.
------ ------------------------------------------------------
The code in question:
composer/src/Composer/Command/InitCommand.php
Lines 460 to 463 in df22988
| foreach ($requires as $requiredPackage) { | |
| $existingPackages[] = substr($requiredPackage, 0, strpos($requiredPackage, ' ')); | |
| } | |
| unset($composer, $installedRepo, $requiredPackage); |
The truthy $requires is eliminated a few lines above in if ($requires) that ends with return $result.
The foreach on line 460 can probably just be deleted, or maybe it's meant to mean something else and needs to be modified :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels