Issue #3301205 by Spokje, mondrake, Gábor Hojtsy, quietone, catch, xjm: Replace the test class protected $modules deprecation error with a phpstan-drupal rule
(cherry picked from commit 9d64e97e46
)
merge-requests/5366/head
parent
a2b3ceec72
commit
e0ce28fa3f
|
@ -23,7 +23,7 @@
|
||||||
"drupal/coder": "^8.3.10",
|
"drupal/coder": "^8.3.10",
|
||||||
"instaclick/php-webdriver": "^1.4.1",
|
"instaclick/php-webdriver": "^1.4.1",
|
||||||
"justinrainbow/json-schema": "^5.2",
|
"justinrainbow/json-schema": "^5.2",
|
||||||
"mglaman/phpstan-drupal": "^1.2",
|
"mglaman/phpstan-drupal": "^1.2.1",
|
||||||
"micheh/phpcs-gitlab": "^1.1",
|
"micheh/phpcs-gitlab": "^1.1",
|
||||||
"mikey179/vfsstream": "^1.6.11",
|
"mikey179/vfsstream": "^1.6.11",
|
||||||
"open-telemetry/exporter-otlp": "^1",
|
"open-telemetry/exporter-otlp": "^1",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "6de6a531a498d73d06d78800399c841f",
|
"content-hash": "a13d08162bfae1cd2d3e808e6765474a",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "asm89/stack-cors",
|
"name": "asm89/stack-cors",
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"drupal/coder": "^8.3.10",
|
"drupal/coder": "^8.3.10",
|
||||||
"instaclick/php-webdriver": "^1.4.1",
|
"instaclick/php-webdriver": "^1.4.1",
|
||||||
"justinrainbow/json-schema": "^5.2",
|
"justinrainbow/json-schema": "^5.2",
|
||||||
"mglaman/phpstan-drupal": "^1.2",
|
"mglaman/phpstan-drupal": "^1.2.1",
|
||||||
"micheh/phpcs-gitlab": "^1.1",
|
"micheh/phpcs-gitlab": "^1.1",
|
||||||
"mikey179/vfsstream": "^1.6.11",
|
"mikey179/vfsstream": "^1.6.11",
|
||||||
"open-telemetry/exporter-otlp": "^1",
|
"open-telemetry/exporter-otlp": "^1",
|
||||||
|
|
|
@ -51,11 +51,6 @@ class DrupalListener implements TestListener {
|
||||||
*/
|
*/
|
||||||
public function startTest(Test $test): void {
|
public function startTest(Test $test): void {
|
||||||
$this->symfonyListener->startTest($test);
|
$this->symfonyListener->startTest($test);
|
||||||
// Check for incorrect visibility of the $modules property.
|
|
||||||
$class = new \ReflectionClass($test);
|
|
||||||
if ($class->hasProperty('modules') && !$class->getProperty('modules')->isProtected()) {
|
|
||||||
@trigger_error('Declaring ' . get_class($test) . '::$modules with public visibility is deprecated in drupal:9.1.0 and must be declared protected in drupal:10.0.0. See https://www.drupal.org/node/2909426', E_USER_DEPRECATED);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue