Skip to content

Commit 652d822

Browse files
committed
minor #12968 Deprecations (jzawadzki, dkvk, nicolas-grekas, picur, mrcmorales)
This PR was merged into the 2.7 branch. Discussion ---------- Deprecations | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12625, #12605, #12628, #12622, #12642, #12609, #12651, #12604, #12607, #12667, #12648 | License | MIT | Doc PR | - Cherry-picking some pending PRs to make them move forward Commits ------- badf8fc [Form] Log deprecation of constants, fixes #12607 #12667 1d58df4 Fix deprecation notice on VirtualFormAwareIterator e2a19ee Add a deprecation note about VirtualFormAwareIterator ab4d9b8 Add a deprecation note about CsrfProviderInterface cb70632 [HttpKernel] fix deprecation notice for Kernel::init() b5a315d [HttpKernel] Added deprecated error to init() 70012c1 [Hackday] [2.7] Add a deprecation note about TypeTestCase
2 parents 89bf101 + a298302 commit 652d822

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Kernel.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ public function __construct($environment, $debug)
8585
$this->startTime = microtime(true);
8686
}
8787

88-
$this->init();
88+
$defClass = new \ReflectionMethod($this, 'init');
89+
$defClass = $defClass->getDeclaringClass()->name;
90+
91+
if (__CLASS__ !== $defClass) {
92+
trigger_error(sprintf('Calling %s::init() was deprecated in Symfony 2.3 and will be removed in 3.0. Move your logic to the constructor instead.', $defClass), E_USER_DEPRECATED);
93+
$this->init();
94+
}
8995
}
9096

9197
/**

Tests/DataCollector/ConfigDataCollectorTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ public function registerBundles()
6969
{
7070
}
7171

72-
public function init()
73-
{
74-
}
75-
7672
public function getBundles()
7773
{
7874
return array();

0 commit comments

Comments
 (0)