Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Composer/InstalledPackageResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
final class InstalledPackageResolver
{
/**
* @var InstalledPackage[]
* @var null|InstalledPackage[]
*/
private array $resolvedInstalledPackages = [];
private ?array $resolvedInstalledPackages = null;

public function __construct(
private readonly ?string $projectDirectory = null
Expand All @@ -37,8 +37,8 @@ public function __construct(
*/
public function resolve(): array
{
// cache
if ($this->resolvedInstalledPackages !== []) {
// already cached, even only empty array
if ($this->resolvedInstalledPackages !== null) {
return $this->resolvedInstalledPackages;
}

Expand Down
Loading