Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5417675

Browse files
committed
feature #12854 [3.0][HttpKernel] Remove unused method Kernel::isClassInActiveBundle (hacfi)
This PR was merged into the 3.0-dev branch. Discussion ---------- [3.0][HttpKernel] Remove unused method Kernel::isClassInActiveBundle | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | yes, if using isClassInActiveBundle (not used by Symfony itself) | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #11652 | License | MIT | Doc PR | - (Not mentioned in the docs) Follow-up of #11869 Commits ------- 91dcca4 [HttpKernel] Remove unused method Kernel::isClassInActiveBundle
2 parents cb9f834 + 91dcca4 commit 5417675

File tree

5 files changed

+1
-86
lines changed

5 files changed

+1
-86
lines changed

src/Symfony/Component/HttpKernel/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
-----
66

77
* Removed `Symfony\Component\HttpKernel\Kernel::init()`
8+
* Removed `Symfony\Component\HttpKernel\Kernel::isClassInActiveBundle()` and `Symfony\Component\HttpKernel\KernelInterface::isClassInActiveBundle()`
89

910
2.6.0
1011
-----

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -196,26 +196,6 @@ public function getBundles()
196196
return $this->bundles;
197197
}
198198

199-
/**
200-
* {@inheritdoc}
201-
*
202-
* @api
203-
*
204-
* @deprecated Deprecated since version 2.6, to be removed in 3.0.
205-
*/
206-
public function isClassInActiveBundle($class)
207-
{
208-
trigger_error('Symfony\\Component\\HttpKernel\\Kernel::isClassInActiveBundle() is deprecated since version 2.6 and will be removed in version 3.0.', E_USER_DEPRECATED);
209-
210-
foreach ($this->getBundles() as $bundle) {
211-
if (0 === strpos($class, $bundle->getNamespace())) {
212-
return true;
213-
}
214-
}
215-
216-
return false;
217-
}
218-
219199
/**
220200
* {@inheritdoc}
221201
*

src/Symfony/Component/HttpKernel/KernelInterface.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,6 @@ public function shutdown();
6969
*/
7070
public function getBundles();
7171

72-
/**
73-
* Checks if a given class name belongs to an active bundle.
74-
*
75-
* @param string $class A class name
76-
*
77-
* @return bool true if the class belongs to an active bundle, false otherwise
78-
*
79-
* @api
80-
*
81-
* @deprecated Deprecated since version 2.6, to be removed in 3.0.
82-
*/
83-
public function isClassInActiveBundle($class);
84-
8572
/**
8673
* Returns a bundle and optionally its descendants by its name.
8774
*

src/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Symfony/Component/HttpKernel/Tests/KernelTest.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\HttpFoundation\Response;
1818
use Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest;
1919
use Symfony\Component\HttpKernel\Tests\Fixtures\KernelForOverrideName;
20-
use Symfony\Component\HttpKernel\Tests\Fixtures\FooBarBundle;
2120

2221
class KernelTest extends \PHPUnit_Framework_TestCase
2322
{
@@ -279,39 +278,6 @@ public function doStuff()
279278
$this->assertEquals($expected, $output);
280279
}
281280

282-
public function testIsClassInActiveBundleFalse()
283-
{
284-
$kernel = $this->getKernelMockForIsClassInActiveBundleTest();
285-
286-
$this->assertFalse($kernel->isClassInActiveBundle('Not\In\Active\Bundle'));
287-
}
288-
289-
public function testIsClassInActiveBundleFalseNoNamespace()
290-
{
291-
$kernel = $this->getKernelMockForIsClassInActiveBundleTest();
292-
293-
$this->assertFalse($kernel->isClassInActiveBundle('NotNamespacedClass'));
294-
}
295-
296-
public function testIsClassInActiveBundleTrue()
297-
{
298-
$kernel = $this->getKernelMockForIsClassInActiveBundleTest();
299-
300-
$this->assertTrue($kernel->isClassInActiveBundle(__NAMESPACE__.'\Fixtures\FooBarBundle\SomeClass'));
301-
}
302-
303-
protected function getKernelMockForIsClassInActiveBundleTest()
304-
{
305-
$bundle = new FooBarBundle();
306-
307-
$kernel = $this->getKernel(array('getBundles'));
308-
$kernel->expects($this->once())
309-
->method('getBundles')
310-
->will($this->returnValue(array($bundle)));
311-
312-
return $kernel;
313-
}
314-
315281
public function testGetRootDir()
316282
{
317283
$kernel = new KernelForTest('test', true);

0 commit comments

Comments
 (0)