Skip to content

Commit

Permalink
Require the top level installed versions (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored Jan 3, 2024
1 parent 88e6f83 commit 6411431
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/TodoByPackageVersionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ public function __construct(
) {
$this->workingDirectory = $workingDirectory;
$this->errorBuilder = $errorBuilder;

// require the top level installed versions, so we don't mix it up with the one in phpstan.phar
$installedVersions = $this->workingDirectory . '/vendor/composer/InstalledVersions.php';
if (!class_exists(InstalledVersions::class, false) && is_readable($installedVersions)) {
require_once $installedVersions;
}
}

public function getNodeType(): string
Expand Down

0 comments on commit 6411431

Please sign in to comment.