diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ea4d9a8..1dc2876 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,28 +15,28 @@ jobs: include: - php: '7.2' symfony: '2.8.*' - phpstan: .phpstan/default.neon + phpstan: .phpstan/symfony_4.neon - php: '7.2' symfony: '3.0.*' - phpstan: .phpstan/default.neon + phpstan: .phpstan/symfony_4.neon - php: '7.2' symfony: '3.1.*' - phpstan: .phpstan/default.neon + phpstan: .phpstan/symfony_4.neon - php: '7.2' symfony: '3.2.*' - phpstan: .phpstan/default.neon + phpstan: .phpstan/symfony_4.neon - php: '7.2' symfony: '3.3.*' - phpstan: .phpstan/default.neon + phpstan: .phpstan/symfony_4.neon - php: '7.2' symfony: '3.4.*' - phpstan: .phpstan/default.neon + phpstan: .phpstan/symfony_4.neon - php: '7.2' symfony: '4.0.*' - phpstan: .phpstan/default.neon + phpstan: .phpstan/symfony_4.neon - php: '7.2' symfony: '4.1.*' - phpstan: .phpstan/default.neon + phpstan: .phpstan/symfony_4.neon - php: '7.2' symfony: '4.2.*' phpstan: .phpstan/default.neon diff --git a/.phpstan/symfony_4.neon b/.phpstan/symfony_4.neon new file mode 100644 index 0000000..04134cd --- /dev/null +++ b/.phpstan/symfony_4.neon @@ -0,0 +1,8 @@ +# config for Symfony 2.8-4.1 + +includes: + - default.neon + +parameters: + ignoreErrors: + - '#Class Symfony\\Component\\Config\\Definition\\Builder\\TreeBuilder does not have a constructor and must be instantiated without any parameters.#' \ No newline at end of file diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 3398f37..80cd13e 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -125,7 +125,7 @@ private function createTreeBuilder(string $name): TreeBuilder { // Symfony 4.2 + if (method_exists(TreeBuilder::class, '__construct')) { - return new TreeBuilder($name); /** @phpstan-ignore-line */ + return new TreeBuilder($name); } // Symfony 4.1 and below