Skip to content

[DI] Add missing deprecation in ContainerBuilder::addCompilerPass #20410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[DI] Add missing deprecation in ContainerBuilder::addCompilerPass
  • Loading branch information
nicolas-grekas committed Nov 4, 2016
commit c0e880e277fba48b51c25e077ecef477c57e7bac
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig:
if (func_num_args() >= 3) {
$priority = func_get_arg(2);
} else {
if (__CLASS__ !== get_class($this)) {
$r = new \ReflectionMethod($this, __FUNCTION__);
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
@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);
}
}

$priority = 0;
}

Expand Down