diff --git a/Plugin.php b/Plugin.php index 35ab809..ea3540b 100644 --- a/Plugin.php +++ b/Plugin.php @@ -27,7 +27,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[] */