Skip to content

Commit

Permalink
Better ignore-by-php-version.neon.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes authored and Seldaek committed Feb 24, 2022
1 parent beb575d commit 4fdcfb1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions phpstan/ignore-by-php-version.neon.php
@@ -1,14 +1,12 @@
<?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
$config = [];
$includes = [];
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;

return $config;

0 comments on commit 4fdcfb1

Please sign in to comment.