From f71e3bc60816d6a139fd3ad063041c66541e0818 Mon Sep 17 00:00:00 2001 From: Philipp Wahala Date: Sat, 6 Sep 2014 18:49:23 +0200 Subject: [PATCH 1/3] #11652 [HttpKernel] Remove unused method Kernel::isClassInActiveBundle --- src/Symfony/Component/HttpKernel/CHANGELOG.md | 1 + src/Symfony/Component/HttpKernel/Kernel.php | 4 ++++ src/Symfony/Component/HttpKernel/KernelInterface.php | 2 ++ .../HttpKernel/Tests/Fixtures/FooBarBundle.php | 3 +++ .../Component/HttpKernel/Tests/KernelTest.php | 12 ++++++++++++ 5 files changed, 22 insertions(+) diff --git a/src/Symfony/Component/HttpKernel/CHANGELOG.md b/src/Symfony/Component/HttpKernel/CHANGELOG.md index 4d0b6149fd8fa..ed7f6035ace95 100644 --- a/src/Symfony/Component/HttpKernel/CHANGELOG.md +++ b/src/Symfony/Component/HttpKernel/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGELOG ----- * deprecated `Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener`, use `Symfony\Component\HttpKernel\EventListener\DebugHandlersListener` instead + * deprecated unused method `Symfony\Component\HttpKernel\Kernel::isClassInActiveBundle` and `Symfony\Component\HttpKernel\KernelInterface::isClassInActiveBundle` 2.5.0 ----- diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index b5e3744de6f0e..5fd54094f941b 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -209,9 +209,13 @@ public function getBundles() * {@inheritdoc} * * @api + * + * @deprecated Deprecated since version 2.6, to be removed in 3.0. */ public function isClassInActiveBundle($class) { + trigger_error('isClassInActiveBundle is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED); + foreach ($this->getBundles() as $bundle) { if (0 === strpos($class, $bundle->getNamespace())) { return true; diff --git a/src/Symfony/Component/HttpKernel/KernelInterface.php b/src/Symfony/Component/HttpKernel/KernelInterface.php index 922f63180ffab..e03c1518f337a 100644 --- a/src/Symfony/Component/HttpKernel/KernelInterface.php +++ b/src/Symfony/Component/HttpKernel/KernelInterface.php @@ -77,6 +77,8 @@ public function getBundles(); * @return bool true if the class belongs to an active bundle, false otherwise * * @api + * + * @deprecated Deprecated since version 2.6, to be removed in 3.0. */ public function isClassInActiveBundle($class); diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php index f940f83696134..2caae4aad1e8c 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php @@ -13,6 +13,9 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; +/** + * @deprecated Deprecated since version 2.6, to be removed in 3.0. + */ class FooBarBundle extends Bundle { // We need a full namespaced bundle instance to test isClassInActiveBundle diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index bc9876df3b12c..9e3b4b7e29b96 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -279,6 +279,9 @@ public function doStuff() $this->assertEquals($expected, $output); } + /** + * @deprecated Deprecated since version 2.6, to be removed in 3.0. + */ public function testIsClassInActiveBundleFalse() { $kernel = $this->getKernelMockForIsClassInActiveBundleTest(); @@ -286,6 +289,9 @@ public function testIsClassInActiveBundleFalse() $this->assertFalse($kernel->isClassInActiveBundle('Not\In\Active\Bundle')); } + /** + * @deprecated Deprecated since version 2.6, to be removed in 3.0. + */ public function testIsClassInActiveBundleFalseNoNamespace() { $kernel = $this->getKernelMockForIsClassInActiveBundleTest(); @@ -293,6 +299,9 @@ public function testIsClassInActiveBundleFalseNoNamespace() $this->assertFalse($kernel->isClassInActiveBundle('NotNamespacedClass')); } + /** + * @deprecated Deprecated since version 2.6, to be removed in 3.0. + */ public function testIsClassInActiveBundleTrue() { $kernel = $this->getKernelMockForIsClassInActiveBundleTest(); @@ -300,6 +309,9 @@ public function testIsClassInActiveBundleTrue() $this->assertTrue($kernel->isClassInActiveBundle(__NAMESPACE__.'\Fixtures\FooBarBundle\SomeClass')); } + /** + * @deprecated Deprecated since version 2.6, to be removed in 3.0. + */ protected function getKernelMockForIsClassInActiveBundleTest() { $bundle = new FooBarBundle(); From 4c8fe1a308142a91de57b3b750df1b487125dc25 Mon Sep 17 00:00:00 2001 From: Philipp Wahala Date: Mon, 8 Sep 2014 05:09:37 +0200 Subject: [PATCH 2/3] #11652 [HttpKernel] Remove trigger_error --- src/Symfony/Component/HttpKernel/Kernel.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 5fd54094f941b..a741ed85e7a49 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -214,8 +214,6 @@ public function getBundles() */ public function isClassInActiveBundle($class) { - trigger_error('isClassInActiveBundle is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED); - foreach ($this->getBundles() as $bundle) { if (0 === strpos($class, $bundle->getNamespace())) { return true; From 0a0f79721de00f1e22952d29f83a607cd86b0d2d Mon Sep 17 00:00:00 2001 From: Philipp Wahala Date: Mon, 8 Sep 2014 20:56:16 +0200 Subject: [PATCH 3/3] #11652 [HttpKernel] Reverse deprecated tests --- .../HttpKernel/Tests/Fixtures/FooBarBundle.php | 3 --- .../Component/HttpKernel/Tests/KernelTest.php | 12 ------------ 2 files changed, 15 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php index 2caae4aad1e8c..f940f83696134 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php @@ -13,9 +13,6 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; -/** - * @deprecated Deprecated since version 2.6, to be removed in 3.0. - */ class FooBarBundle extends Bundle { // We need a full namespaced bundle instance to test isClassInActiveBundle diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index 9e3b4b7e29b96..bc9876df3b12c 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -279,9 +279,6 @@ public function doStuff() $this->assertEquals($expected, $output); } - /** - * @deprecated Deprecated since version 2.6, to be removed in 3.0. - */ public function testIsClassInActiveBundleFalse() { $kernel = $this->getKernelMockForIsClassInActiveBundleTest(); @@ -289,9 +286,6 @@ public function testIsClassInActiveBundleFalse() $this->assertFalse($kernel->isClassInActiveBundle('Not\In\Active\Bundle')); } - /** - * @deprecated Deprecated since version 2.6, to be removed in 3.0. - */ public function testIsClassInActiveBundleFalseNoNamespace() { $kernel = $this->getKernelMockForIsClassInActiveBundleTest(); @@ -299,9 +293,6 @@ public function testIsClassInActiveBundleFalseNoNamespace() $this->assertFalse($kernel->isClassInActiveBundle('NotNamespacedClass')); } - /** - * @deprecated Deprecated since version 2.6, to be removed in 3.0. - */ public function testIsClassInActiveBundleTrue() { $kernel = $this->getKernelMockForIsClassInActiveBundleTest(); @@ -309,9 +300,6 @@ public function testIsClassInActiveBundleTrue() $this->assertTrue($kernel->isClassInActiveBundle(__NAMESPACE__.'\Fixtures\FooBarBundle\SomeClass')); } - /** - * @deprecated Deprecated since version 2.6, to be removed in 3.0. - */ protected function getKernelMockForIsClassInActiveBundleTest() { $bundle = new FooBarBundle();