Skip to content
Snippets Groups Projects
Commit 8dbf5069 authored by Tim Plunkett's avatar Tim Plunkett Committed by Chris Wells
Browse files

Issue #3507536 by tim.plunkett, fjgarlin: Switch to conditional usage of...

Issue #3507536 by tim.plunkett, fjgarlin: Switch to conditional usage of PHPStan for upstream incompatibilities
parent 2e63ded7
No related branches found
No related tags found
1 merge request!737Issue #3507536: Switch to conditional usage of PHPStan for upstream incompatibilities
Pipeline #429103 failed
parameters:
ignoreErrors:
-
message: "#^Call to function method_exists\\(\\) with 'Drupal\\\\\\\\Core\\\\\\\\Recipe\\\\\\\\Recipe' and 'getExtra' will always evaluate to true\\.$#"
identifier: function.alreadyNarrowedType
count: 1
path: src/Activator/RecipeActivator.php
-
message: "#^Call to function method_exists\\(\\) with 'Drupal\\\\\\\\Core\\\\\\\\Recipe\\\\\\\\Recipe' and 'getExtra' will always evaluate to true\\.$#"
identifier: function.alreadyNarrowedType
count: 1
path: tests/src/Kernel/RecipeActivatorTest.php
parameters:
ignoreErrors:
-
message: "#^Call to function method_exists\\(\\) with 'Drupal\\\\\\\\Core\\\\\\\\Recipe\\\\\\\\Recipe' and 'getExtra' will always evaluate to false\\.$#"
identifier: function.impossibleType
count: 1
path: src/Activator/RecipeActivator.php
-
message: "#^Call to function method_exists\\(\\) with 'Drupal\\\\\\\\Core\\\\\\\\Recipe\\\\\\\\Recipe' and 'getExtra' will always evaluate to false\\.$#"
identifier: function.impossibleType
count: 1
path: tests/src/Kernel/RecipeActivatorTest.php
-
message: "#^Call to an undefined method Drupal\\\\Core\\\\Recipe\\\\Recipe\\:\\:getExtra\\(\\)\\.$#"
identifier: method.notFound
count: 1
path: src/Activator/RecipeActivator.php
<?php
/**
* @file
* Allows for specific PHPStan ignores for different versions of Drupal core.
*/
declare(strict_types = 1);
use Drupal\Core\Recipe\Recipe;
$includes = [];
if (method_exists(Recipe::class, 'getExtra')) {
$includes[] = 'phpstan-baseline-getExtras.neon';
}
else {
$includes[] = 'phpstan-baseline-no-getExtras.neon';
}
$config = [];
$config['includes'] = $includes;
return $config;
includes:
- phpstan-drupal-core-bc-layer.neon.php
parameters: parameters:
level: 8 level: 8
universalObjectCratesClasses: universalObjectCratesClasses:
- Drupal\Core\Extension\Extension - Drupal\Core\Extension\Extension
reportUnmatchedIgnoredErrors: true reportUnmatchedIgnoredErrors: true
excludePaths: excludePaths:
- phpstan-drupal-core-bc-layer.neon.php
# The scripts directory does not contain runtime code. # The scripts directory does not contain runtime code.
- scripts - scripts
# The node_modules contains some PHP to ignore. # The node_modules contains some PHP to ignore.
...@@ -22,46 +25,39 @@ parameters: ...@@ -22,46 +25,39 @@ parameters:
# Caused by missing return type on \Drupal\FunctionalJavascriptTests\WebDriverTestBase::assertSession(). # Caused by missing return type on \Drupal\FunctionalJavascriptTests\WebDriverTestBase::assertSession().
- -
message: "#^Call to an undefined method Drupal\\\\Tests\\\\WebAssert\\:\\:assert[a-zA-Z]+\\(\\)\\.$#" message: "#^Call to an undefined method Drupal\\\\Tests\\\\WebAssert\\:\\:assert[a-zA-Z]+\\(\\)\\.$#"
identifier: method.notFound
paths: paths:
- tests/src/FunctionalJavascript - tests/src/FunctionalJavascript
reportUnmatched: false reportUnmatched: false
# Caused by missing return type on \Drupal\FunctionalJavascriptTests\WebDriverTestBase::assertSession(). # Caused by missing return type on \Drupal\FunctionalJavascriptTests\WebDriverTestBase::assertSession().
- -
message: "#^Call to an undefined method Drupal\\\\Tests\\\\WebAssert\\:\\:wait[a-zA-Z]+\\(\\)\\.$#" message: "#^Call to an undefined method Drupal\\\\Tests\\\\WebAssert\\:\\:wait[a-zA-Z]+\\(\\)\\.$#"
identifier: method.notFound
paths: paths:
- tests/src/FunctionalJavascript - tests/src/FunctionalJavascript
reportUnmatched: false reportUnmatched: false
# Caused by \Drupal\KernelTests\KernelTestBase::$container having the wrong type. # Caused by \Drupal\KernelTests\KernelTestBase::$container having the wrong type.
- -
message: "#^Property Drupal\\\\KernelTests\\\\KernelTestBase\\:\\:\\$container \\(Drupal\\\\Core\\\\DependencyInjection\\\\ContainerBuilder\\) does not accept Drupal\\\\Component\\\\DependencyInjection\\\\ContainerInterface\\.$#" message: "#^Property Drupal\\\\KernelTests\\\\KernelTestBase\\:\\:\\$container \\(Drupal\\\\Core\\\\DependencyInjection\\\\ContainerBuilder\\) does not accept Drupal\\\\Component\\\\DependencyInjection\\\\ContainerInterface\\.$#"
identifier: assign.propertyType
paths: paths:
- tests/src/Kernel/DatabaseTablesTest.php - tests/src/Kernel/DatabaseTablesTest.php
reportUnmatched: false reportUnmatched: false
# Caused by \Drupal\Tests\user\Traits\UserCreationTrait::createUser() returning FALSE instead of throwing an exception. # Caused by \Drupal\Tests\user\Traits\UserCreationTrait::createUser() returning FALSE instead of throwing an exception.
- -
message: "#^Parameter \\#1 \\$account of method Drupal\\\\Tests\\\\BrowserTestBase\\:\\:drupalLogin\\(\\) expects Drupal\\\\Core\\\\Session\\\\AccountInterface, Drupal\\\\user\\\\Entity\\\\User\\|false given\\.$#" message: "#^Parameter \\#1 \\$account of method Drupal\\\\Tests\\\\BrowserTestBase\\:\\:drupalLogin\\(\\) expects Drupal\\\\Core\\\\Session\\\\AccountInterface, Drupal\\\\user\\\\Entity\\\\User\\|false given\\.$#"
identifier: argument.type
paths: paths:
- tests/src/Functional - tests/src/Functional
- tests/src/FunctionalJavascript - tests/src/FunctionalJavascript
reportUnmatched: false reportUnmatched: false
# @todo Remove the next two ignores when Drupal 11.1.3 is the minimum supported version of core.
-
message: "#^Call to an undefined method Drupal\\\\Core\\\\Recipe\\\\Recipe\\:\\:getExtra\\(\\)\\.$#"
count: 1
path: src/Activator/RecipeActivator.php
reportUnmatched: false
-
message: "#^Call to function method_exists\\(\\) with 'Drupal\\\\\\\\Core\\\\\\\\Recipe\\\\\\\\Recipe' and 'getExtra' will always evaluate to (true|false)\\.$#"
paths:
- src/Activator/RecipeActivator.php
- tests/src/Kernel/RecipeActivatorTest.php
reportUnmatched: false
### Package Manager ### Package Manager
# @todo Remove after resolving https://www.drupal.org/i/3501836. # @todo Remove after resolving https://www.drupal.org/i/3501836.
# Caused by using self instead of static as a return type in \Drupal\fixture_manipulator\FixtureManipulator. # Caused by using self instead of static as a return type in \Drupal\fixture_manipulator\FixtureManipulator.
- -
message: "#^Method Drupal\\\\fixture_manipulator\\\\FixtureManipulator\\:\\:commitChanges\\(\\) invoked with 0 parameters, 1 required\\.$#" message: "#^Method Drupal\\\\fixture_manipulator\\\\FixtureManipulator\\:\\:commitChanges\\(\\) invoked with 0 parameters, 1 required\\.$#"
identifier: arguments.count
paths: paths:
- tests/src/Kernel/InstallerTest.php - tests/src/Kernel/InstallerTest.php
- tests/src/Kernel/CoreNotUpdatedValidatorTest.php - tests/src/Kernel/CoreNotUpdatedValidatorTest.php
...@@ -70,12 +66,14 @@ parameters: ...@@ -70,12 +66,14 @@ parameters:
# Caused by missing return type on \Drupal\Tests\package_manager\Traits\FixtureManipulatorTrait::getStageFixtureManipulator(). # Caused by missing return type on \Drupal\Tests\package_manager\Traits\FixtureManipulatorTrait::getStageFixtureManipulator().
- -
message: "#^Call to an undefined method object\\:\\:setCorePackageVersion\\(\\)\\.$#" message: "#^Call to an undefined method object\\:\\:setCorePackageVersion\\(\\)\\.$#"
identifier: method.notFound
paths: paths:
- tests/src/Kernel/CoreNotUpdatedValidatorTest.php - tests/src/Kernel/CoreNotUpdatedValidatorTest.php
reportUnmatched: false reportUnmatched: false
# Caused by missing @throws on \Drupal\package_manager\StageBase::apply(). # Caused by missing @throws on \Drupal\package_manager\StageBase::apply().
- -
message: "#^Dead catch \\- Drupal\\\\package_manager\\\\Exception\\\\StageEventException is never thrown in the try block\\.$#" message: "#^Dead catch \\- Drupal\\\\package_manager\\\\Exception\\\\StageEventException is never thrown in the try block\\.$#"
identifier: catch.neverThrown
paths: paths:
- tests/src/Kernel/CoreNotUpdatedValidatorTest.php - tests/src/Kernel/CoreNotUpdatedValidatorTest.php
reportUnmatched: false reportUnmatched: false
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment