1
0
Fork 0

Better ignore-by-php-version.neon.php

pull/10567/head
Ondřej Mirtes 2022-02-24 13:21:22 +01:00 committed by Jordi Boggiano
parent beb575dd00
commit 4fdcfb166f
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 6 deletions

View File

@ -1,14 +1,12 @@
<?php declare(strict_types = 1); <?php declare(strict_types = 1);
use PHPStan\DependencyInjection\NeonAdapter;
$adapter = new NeonAdapter();
// more inspiration at https://github.com/phpstan/phpstan-src/blob/master/build/ignore-by-php-version.neon.php // more inspiration at https://github.com/phpstan/phpstan-src/blob/master/build/ignore-by-php-version.neon.php
$config = []; $includes = [];
if (PHP_VERSION_ID >= 80000) { if (PHP_VERSION_ID >= 80000) {
$config = array_merge_recursive($config, $adapter->load(__DIR__ . '/baseline-8.1.neon')); $includes[] = __DIR__ . '/baseline-8.1.neon';
} }
$config['includes'] = $includes;
$config['parameters']['phpVersion'] = PHP_VERSION_ID; $config['parameters']['phpVersion'] = PHP_VERSION_ID;
return $config; return $config;