Skip to content

Commit 065ac8b

Browse files
committed
feature #21353 [ClassLoader] Deprecated the component (nicolas-grekas)
This PR was merged into the 3.3-dev branch. Discussion ---------- [ClassLoader] Deprecated the component | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Follow up of #20668 Commits ------- 8a37722 [ClassLoader] Deprecated the component
2 parents a81fc03 + 8a37722 commit 065ac8b

File tree

14 files changed

+52
-30
lines changed

14 files changed

+52
-30
lines changed

UPGRADE-3.3.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ UPGRADE FROM 3.2 to 3.3
44
ClassLoader
55
-----------
66

7-
* The ApcClassLoader, WinCacheClassLoader and XcacheClassLoader classes have been deprecated
8-
in favor of the `--apcu-autoloader` option introduced in composer 1.3
7+
* The component is deprecated and will be removed in 4.0. Use Composer instead.
98

109
DependencyInjection
1110
-------------------

UPGRADE-4.0.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ UPGRADE FROM 3.x to 4.0
44
ClassLoader
55
-----------
66

7-
* The ApcClassLoader, WinCacheClassLoader and XcacheClassLoader classes have been removed
8-
in favor of the `--apcu-autoloader` option introduced in composer 1.3
7+
* The component has been removed. Use Composer instead.
98

109
Console
1110
-------

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Tests\Controller;
1313

14+
use Composer\Autoload\ClassLoader;
1415
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
1516
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
16-
use Symfony\Component\ClassLoader\ClassLoader;
1717

1818
class ControllerNameParserTest extends TestCase
1919
{
@@ -22,17 +22,14 @@ class ControllerNameParserTest extends TestCase
2222
protected function setUp()
2323
{
2424
$this->loader = new ClassLoader();
25-
$this->loader->addPrefixes(array(
26-
'TestBundle' => __DIR__.'/../Fixtures',
27-
'TestApplication' => __DIR__.'/../Fixtures',
28-
));
25+
$this->loader->add('TestBundle', __DIR__.'/../Fixtures');
26+
$this->loader->add('TestApplication', __DIR__.'/../Fixtures');
2927
$this->loader->register();
3028
}
3129

3230
protected function tearDown()
3331
{
34-
spl_autoload_unregister(array($this->loader, 'loadClass'));
35-
32+
$this->loader->unregister();
3633
$this->loader = null;
3734
}
3835

src/Symfony/Component/ClassLoader/CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ CHANGELOG
44
3.3.0
55
-----
66

7-
* The ApcClassLoader, WinCacheClassLoader and XcacheClassLoader classes have been deprecated
8-
in favor of the `--apcu-autoloader` option introduced in composer 1.3
7+
* deprecated the component: use Composer instead
98

109
3.0.0
1110
-----

src/Symfony/Component/ClassLoader/ClassLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\ClassLoader;
1313

14+
@trigger_error('The '.__NAMESPACE__.'\ClassLoader class is deprecated since version 3.3 and will be removed in 4.0. Use Composer instead.', E_USER_DEPRECATED);
15+
1416
/**
1517
* ClassLoader implements an PSR-0 class loader.
1618
*
@@ -36,6 +38,8 @@
3638
*
3739
* @author Fabien Potencier <fabien@symfony.com>
3840
* @author Jordi Boggiano <j.boggiano@seld.be>
41+
*
42+
* @deprecated since version 3.3, to be removed in 4.0.
3943
*/
4044
class ClassLoader
4145
{

src/Symfony/Component/ClassLoader/ClassMapGenerator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111

1212
namespace Symfony\Component\ClassLoader;
1313

14+
@trigger_error('The '.__NAMESPACE__.'\ClassMapGenerator class is deprecated since version 3.3 and will be removed in 4.0. Use Composer instead.', E_USER_DEPRECATED);
15+
1416
/**
1517
* ClassMapGenerator.
1618
*
1719
* @author Gyula Sallai <salla016@gmail.com>
20+
*
21+
* @deprecated since version 3.3, to be removed in 4.0.
1822
*/
1923
class ClassMapGenerator
2024
{

src/Symfony/Component/ClassLoader/MapClassLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111

1212
namespace Symfony\Component\ClassLoader;
1313

14+
@trigger_error('The '.__NAMESPACE__.'\MapClassLoader class is deprecated since version 3.3 and will be removed in 4.0. Use Composer instead.', E_USER_DEPRECATED);
15+
1416
/**
1517
* A class loader that uses a mapping file to look up paths.
1618
*
1719
* @author Fabien Potencier <fabien@symfony.com>
20+
*
21+
* @deprecated since version 3.3, to be removed in 4.0.
1822
*/
1923
class MapClassLoader
2024
{

src/Symfony/Component/ClassLoader/Psr4ClassLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@
1111

1212
namespace Symfony\Component\ClassLoader;
1313

14+
@trigger_error('The '.__NAMESPACE__.'\Psr4ClassLoader class is deprecated since version 3.3 and will be removed in 4.0. Use Composer instead.', E_USER_DEPRECATED);
15+
1416
/**
1517
* A PSR-4 compatible class loader.
1618
*
1719
* See http://www.php-fig.org/psr/psr-4/
1820
*
1921
* @author Alexander M. Turek <me@derrabus.de>
22+
*
23+
* @deprecated since version 3.3, to be removed in 4.0.
2024
*/
2125
class Psr4ClassLoader
2226
{

src/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
use Symfony\Component\ClassLoader\ClassLoader;
1515

16+
/**
17+
* @group legacy
18+
*/
1619
class ClassLoaderTest extends \PHPUnit_Framework_TestCase
1720
{
1821
public function testGetPrefixes()

src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
use Symfony\Component\ClassLoader\ClassMapGenerator;
1515

16+
/**
17+
* @group legacy
18+
*/
1619
class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
1720
{
1821
/**

0 commit comments

Comments
 (0)