Skip to content

Commit

Permalink
Disabled Collection stub for newer doctrine/collections versions
Browse files Browse the repository at this point in the history
Refs #21
  • Loading branch information
weirdan committed Jul 20, 2019
1 parent e554698 commit 85c032d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ public function __invoke(RegistrationInterface $psalm, ?SimpleXMLElement $config
/** @return string[] */
private function getStubFiles(): array
{
return glob(__DIR__ . '/' . 'stubs/*.php');
$files = glob(__DIR__ . '/' . 'stubs/*.php');
[$ver,] = explode('@', $this->getPackageVersion('doctrine/collections'));
if (version_compare($ver, 'v1.6.0', '>=')) {
$files = preg_grep('/Collections\.php$/', $files, PREG_GREP_INVERT);
}
return $files;
}

/** @return string[] */
Expand Down

0 comments on commit 85c032d

Please sign in to comment.