Commit 0540e46d authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Issue #3101448 by mglaman, Gábor Hojtsy: Prepare for phpstan-drupal:^0.12.0...

Issue #3101448 by mglaman, Gábor Hojtsy: Prepare for phpstan-drupal:^0.12.0 (again, but will still fail)
parent aa8f8007
# FROM mglaman/drupal-check/phpstan/deprecation_testing.neon
parameters:
# FROM mglaman/drupal-check/phpstan/deprecation_testing.neon
customRulesetUsed: true
ignoreErrors:
- '#\Drupal calls should be avoided in classes, use dependency injection instead#'
......@@ -9,70 +8,11 @@ parameters:
- '#Plugin manager has cache backend specified but does not declare cache tags.#'
# FROM mglaman/drupal-check/phpstan/base_config.neon
# AND FROM mglaman/phpstan-drupal/extension.neon
reportUnmatchedIgnoredErrors: false
excludes_analyse:
- *.api.php
- */tests/Drupal/Tests/Listeners/Legacy/*
- */tests/fixtures/*.php
- */settings*.php
# FROM mglaman/phpstan-drupal/extension.neon
fileExtensions:
- module
- theme
- inc
- install
- profile
- engine
extensions:
# FROM mglaman/phpstan-drupal/extension.neon
drupal: PHPStan\DependencyInjection\DrupalExtension
drupal:
# FROM mglaman/phpstan-drupal/extension.neon
entityTypeStorageMapping:
node: Drupal\node\NodeStorage
taxonomy_term: Drupal\taxonomy\TermStorage
user: Drupal\user\UserStorage
rules:
# FROM mglaman/phpstan-drupal/extension.neon
- PHPStan\Rules\Classes\PluginManagerInspectionRule
- PHPStan\Rules\Drupal\Coder\DiscouragedFunctionsRule
- PHPStan\Rules\Drupal\GlobalDrupalDependencyInjectionRule
- PHPStan\Rules\Drupal\PluginManager\PluginManagerSetsCacheBackendRule
- PHPStan\Rules\Deprecations\AccessDeprecatedConstant
# FROM phpstan/phpstan-deprecation-rules/rules.neon
- PHPStan\Rules\Deprecations\AccessDeprecatedPropertyRule
- PHPStan\Rules\Deprecations\AccessDeprecatedStaticPropertyRule
- PHPStan\Rules\Deprecations\CallToDeprecatedFunctionRule
- PHPStan\Rules\Deprecations\CallToDeprecatedMethodRule
- PHPStan\Rules\Deprecations\CallToDeprecatedStaticMethodRule
- PHPStan\Rules\Deprecations\FetchingClassConstOfDeprecatedClassRule
- PHPStan\Rules\Deprecations\ImplementationOfDeprecatedInterfaceRule
- PHPStan\Rules\Deprecations\InheritanceOfDeprecatedClassRule
- PHPStan\Rules\Deprecations\InheritanceOfDeprecatedInterfaceRule
- PHPStan\Rules\Deprecations\InstantiationOfDeprecatedClassRule
- PHPStan\Rules\Deprecations\UsageOfDeprecatedTraitRule
services:
# FROM mglaman/phpstan-drupal/extension.neon
drupal.serviceMapFactory:
class: PHPStan\Drupal\ServiceMapFactory
factory: PHPStan\Drupal\ServiceMapFactory(%drupalServiceMap%)
-
class: @drupal.serviceMapFactory::create()
-
class: PHPStan\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension
arguments:
entityTypeStorageMapping: %drupal.entityTypeStorageMapping%
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]
-
class: PHPStan\Type\ServiceDynamicReturnTypeExtension
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]
-
class: PHPStan\Reflection\EntityFieldsViaMagicReflectionExtension
tags: [phpstan.broker.propertiesClassReflectionExtension]
includes:
- deprecation_testing.php
<?php
// The files we need to include.
$files = [
'vendor/mglaman/phpstan-drupal/extension.neon',
'vendor/phpstan/phpstan-deprecation-rules/rules.neon'
];
// Various possibilities as to where the module is placed and where the vendor
// directory is based on how the site is set up. This set may or may not be
// comprehensive.
$dirs = [
__DIR__ . '/../../../',
__DIR__ . '/../../../../',
__DIR__ . '/../../../../../',
__DIR__ . '/../../../../../../',
__DIR__ . '/../../../../../../../',
];
foreach ($dirs as $dir) {
if (file_exists($dir . $files[0])) {
$neon = ['includes' => []];
foreach ($files as $file_path) {
$neon['includes'][] = $dir . $file_path;
}
return $neon;
}
}
return [];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment