File tree Expand file tree Collapse file tree 4 files changed +16
-13
lines changed Expand file tree Collapse file tree 4 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 12
12
"php" : " ^7.1" ,
13
13
"phpstan/phpstan" : " ^0.11" ,
14
14
"symfony/yaml" : " ~3.4.5|^4.2" ,
15
- "webflo/drupal-finder" : " ^1.1"
15
+ "webflo/drupal-finder" : " ^1.1" ,
16
+ "nette/di" : " ^3.0"
16
17
},
17
18
"require-dev" : {
18
19
"phpstan/phpstan-strict-rules" : " ^0.11" ,
23
24
"drupal/core" : " ^8.6" ,
24
25
"drush/drush" : " ^9.6"
25
26
},
26
- "conflict" : {
27
- "nette/di" : " >=3.0"
28
- },
29
27
"minimum-stability" : " dev" ,
30
28
"prefer-stable" : true ,
31
29
"suggest" : {
Original file line number Diff line number Diff line change 1
1
includes :
2
2
- vendor/phpstan/phpstan-strict-rules/rules.neon
3
+ - vendor/phpstan/phpstan-deprecation-rules/rules.neon
3
4
parameters :
4
5
level : 7
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class DrupalExtension extends CompilerExtension
59
59
public function loadConfiguration (): void
60
60
{
61
61
/** @var array */
62
- $ config = Helpers::merge ($ this ->config , $ this ->defaultConfig );
62
+ $ config = Nette \ Schema \ Helpers::merge ($ this ->config , $ this ->defaultConfig );
63
63
64
64
$ finder = new DrupalFinder ();
65
65
@@ -87,12 +87,12 @@ public function loadConfiguration(): void
87
87
88
88
$ builder = $ this ->getContainerBuilder ();
89
89
foreach ($ builder ->getDefinitions () as $ definition ) {
90
- $ factory = $ definition-> getFactory ();
91
- if ( $ factory === null ) {
92
- continue ;
93
- }
94
- if ( $ factory -> entity === RequireParentConstructCallRule ::class) {
95
- $ definition -> setFactory (EnhancedRequireParentConstructCallRule::class);
90
+ if ( $ definition instanceof Nette \ DI \ Definitions \FactoryDefinition) {
91
+ $ resultDefinition = $ definition -> getResultDefinition ();
92
+ $ factory = $ resultDefinition -> getFactory () ;
93
+ if ( $ factory -> entity === RequireParentConstructCallRule::class) {
94
+ $ resultDefinition -> setFactory (EnhancedRequireParentConstructCallRule ::class);
95
+ }
96
96
}
97
97
}
98
98
Original file line number Diff line number Diff line change @@ -24,14 +24,18 @@ public function dataDeprecatedSamples(): \Generator
24
24
2 ,
25
25
[
26
26
'\Drupal calls should be avoided in classes, use dependency injection instead ' ,
27
- 'Call to deprecated method url() of class Drupal. '
27
+ 'Call to deprecated method url() of class Drupal:
28
+ as of Drupal 8.0.x, will be removed before Drupal 9.0.0.
29
+ Instead create a \Drupal\Core\Url object directly, for example using
30
+ Url::fromRoute(). '
28
31
]
29
32
];
30
33
yield [
31
34
__DIR__ . '/../fixtures/drupal/core/lib/Drupal/Core/Entity/EntityManager.php ' ,
32
35
1 ,
33
36
[
34
- 'Class Drupal\Core\Entity\EntityManager implements deprecated interface Drupal\Core\Entity\EntityManagerInterface. '
37
+ 'Class Drupal\Core\Entity\EntityManager implements deprecated interface Drupal\Core\Entity\EntityManagerInterface:
38
+ in Drupal 8.0.0, will be removed before Drupal 9.0.0. '
35
39
]
36
40
];
37
41
}
You can’t perform that action at this time.
0 commit comments