Skip to content

Commit aae3978

Browse files
committed
Dump PHPStan version constraint for each package
1 parent bfd401b commit aae3978

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Plugin.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -153,21 +153,22 @@ public function process(Event $event): void
153153
? $installPath
154154
: getcwd() . DIRECTORY_SEPARATOR . $installPath;
155155

156+
$packageRequires = $package->getRequires();
157+
$phpstanConstraint = null;
158+
if (array_key_exists('phpstan/phpstan', $packageRequires)) {
159+
$phpstanConstraint = $packageRequires['phpstan/phpstan']->getConstraint();
160+
$phpstanVersionConstraints[] = $phpstanConstraint;
161+
}
162+
156163
$data[$package->getName()] = [
157164
'install_path' => $absoluteInstallPath,
158165
'relative_install_path' => $fs->findShortestPath(dirname($generatedConfigFilePath), $absoluteInstallPath, true),
159166
'extra' => $package->getExtra()['phpstan'] ?? null,
160167
'version' => $package->getFullPrettyVersion(),
168+
'phpstanVersionConstraint' => $phpstanConstraint !== null ? (string) $phpstanConstraint : null,
161169
];
162170

163171
$installedPackages[$package->getName()] = true;
164-
165-
$packageRequires = $package->getRequires();
166-
if (!array_key_exists('phpstan/phpstan', $packageRequires)) {
167-
continue;
168-
}
169-
170-
$phpstanVersionConstraints[] = $packageRequires['phpstan/phpstan']->getConstraint();
171172
}
172173

173174
$phpstanVersionConstraint = null;

0 commit comments

Comments
 (0)