Skip to content

Commit

Permalink
fix: only add caret to constructed version constraint (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinai authored May 27, 2024
1 parent f5e39a1 commit 2bd60dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/find-composer-packages.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ function getPackageForClass(ClassLoader $loader, string $class)
?? null;
if ($depVersion === null) {
$version = \Composer\InstalledVersions::getVersion($package);
$depVersion = substr($version, 0, strrpos($version, '.'));
$depVersion = '^' . substr($version, 0, strrpos($version, '.'));
}
$done[$package] = true;
echo "\"$package\": \"^$depVersion\"\n";
echo "\"$package\": \"$depVersion\"\n";
} catch (OutOfBoundsException $exception) {
// ignore package
}
Expand Down

0 comments on commit 2bd60dd

Please sign in to comment.