generated from mimmi20/template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
composer-dependency-analyser.php
48 lines (39 loc) · 1.98 KB
/
composer-dependency-analyser.php
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
<?php
/**
* This file is part of the mimmi20/monolog-factory package.
*
* Copyright (c) 2022-2025, Thomas Mueller <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types = 1);
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
$config = new Configuration();
$config
// Adjusting scanned paths
->addPathToScan(__DIR__ . '/src', isDev: false)
->addPathToScan(__DIR__ . '/tests', isDev: true)
->addPathToScan(__DIR__ . '/vendor', isDev: false)
->addPathToExclude(__DIR__ . '/vendor/rector/rector')
->addPathToExclude(__DIR__ . '/vendor/phpstan/phpstan')
// applies only to directory scanning, not directly listed files
->setFileExtensions(['php'])
// Ignoring errors in vendor directory
->ignoreErrorsOnPath(__DIR__ . '/vendor', [ErrorType::SHADOW_DEPENDENCY])
->ignoreErrorsOnPath(__DIR__ . '/vendor', [ErrorType::UNKNOWN_FUNCTION])
->ignoreErrorsOnPath(__DIR__ . '/vendor', [ErrorType::UNKNOWN_CLASS])
->ignoreErrorsOnPath(__DIR__ . '/src', [ErrorType::UNKNOWN_CLASS])
->ignoreErrorsOnPath(__DIR__ . '/tests', [ErrorType::UNKNOWN_CLASS])
->ignoreErrorsOnPath(__DIR__ . '/vendor', [ErrorType::DEV_DEPENDENCY_IN_PROD])
->ignoreErrorsOnPath(__DIR__ . '/src', [ErrorType::DEV_DEPENDENCY_IN_PROD])
// do not complain about some modules
->ignoreErrorsOnPackage('mimmi20/coding-standard', [ErrorType::UNUSED_DEPENDENCY])
->ignoreErrorsOnPackage('phpstan/extension-installer', [ErrorType::UNUSED_DEPENDENCY])
->ignoreErrorsOnPackage('phpstan/phpstan-phpunit', [ErrorType::UNUSED_DEPENDENCY])
->ignoreErrorsOnPackage('phpstan/phpstan-deprecation-rules', [ErrorType::UNUSED_DEPENDENCY])
// Adjust analysis
// dev packages are often used only in CI, so this is not enabled by default
->enableAnalysisOfUnusedDevDependencies();
return $config;