Skip to content

Commit c0e880e

Browse files
[DI] Add missing deprecation in ContainerBuilder::addCompilerPass
1 parent 31d5fff commit c0e880e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig:
316316
if (func_num_args() >= 3) {
317317
$priority = func_get_arg(2);
318318
} else {
319+
if (__CLASS__ !== get_class($this)) {
320+
$r = new \ReflectionMethod($this, __FUNCTION__);
321+
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
322+
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
323+
}
324+
}
325+
319326
$priority = 0;
320327
}
321328

0 commit comments

Comments
 (0)