-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathcomposer-dependency-analyser.php
More file actions
50 lines (44 loc) · 1.88 KB
/
composer-dependency-analyser.php
File metadata and controls
50 lines (44 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
use PHPUnit\Event\Code\IssueTrigger\IssueTrigger;
use PHPUnit\Event\Telemetry\SystemGarbageCollectorStatusProvider;
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
$config = new Configuration();
if (class_exists(SystemGarbageCollectorStatusProvider::class)) {
/**
* Compatibility with PHPUnit ^10.1 || ^11
* @see \Tests\Unit\Logs\TestHook\AbstractTestHookTestCase::createGarbageCollectorStatus()
*/
$config->ignoreUnknownClassesRegex('/PHPUnit\\\Event\\\Telemetry\\\Php81|3GarbageCollectorStatusProvider/');
} else {
/**
* Compatibility with PHPUnit >= 12.0.0
* @see \Tests\Unit\Logs\TestHook\AbstractTestHookTestCase::createGarbageCollectorStatus()
*/
$config->ignoreUnknownClassesRegex('/PHPUnit\\\Event\\\Telemetry\\\SystemGarbageCollectorStatusProvider/');
}
if (! class_exists(IssueTrigger::class)) {
/**
* Compatibility with PHPUnit >= 11.0.0
* @see \Tests\Unit\Logs\TestHook\DeprecationTest
* @see \Tests\Unit\Logs\TestHook\PhpDeprecationTest
*/
$config->ignoreUnknownClassesRegex('/PHPUnit\\\Event\\\Code\\\IssueTrigger\\\Code/');
$config->ignoreUnknownClassesRegex('/PHPUnit\\\Event\\\Code\\\IssueTrigger\\\IssueTrigger/');
}
$config->addPathToScan(__DIR__ . '/.php-cs-fixer.dist.php', true);
$config->addPathToScan(__DIR__ . '/rector.php', true);
$config->addPathToScan(__FILE__, true);
$config->enableAnalysisOfUnusedDevDependencies();
$config->ignoreErrorsOnPackages([
'jangregor/phpstan-prophecy',
'phpstan/extension-installer',
'phpstan/phpstan',
'phpstan/phpstan-phpunit',
'phpunit/php-invoker', // for test timeouts
'psalm/plugin-phpunit',
'psalm/plugin-symfony',
'vimeo/psalm',
], [ErrorType::UNUSED_DEPENDENCY]);
$config->ignoreErrorsOnExtension('ext-pcntl', [ErrorType::DEV_DEPENDENCY_IN_PROD]);
return $config;