Skip to content

Commit

Permalink
Trigger silent deprecations for legacy ClassLoader, Inflector and Lexer
Browse files Browse the repository at this point in the history
  • Loading branch information
Majkl578 committed Jun 15, 2018
1 parent cc0479b commit 39bc396
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"require-dev": {
"phpunit/phpunit": "^6.3",
"doctrine/coding-standard": "^1.0",
"squizlabs/php_codesniffer": "^3.0"
"squizlabs/php_codesniffer": "^3.0",
"symfony/phpunit-bridge": "^4.0.5"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 5 additions & 0 deletions lib/Doctrine/Common/ClassLoader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php
namespace Doctrine\Common;

use function trigger_error;
use const E_USER_DEPRECATED;

@trigger_error(ClassLoader::class . ' is deprecated.', E_USER_DEPRECATED);

/**
* A <tt>ClassLoader</tt> is an autoloader for class files that can be
* installed on the SPL autoload stack. It is a class loader that either loads only classes
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/Common/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
namespace Doctrine\Common;

use Doctrine\Common\Lexer\AbstractLexer;
use function trigger_error;
use const E_USER_DEPRECATED;

@trigger_error(Lexer::class . ' is deprecated.', E_USER_DEPRECATED);

/**
* Base class for writing simple lexers, i.e. for creating small DSLs.
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/Common/Util/Inflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
namespace Doctrine\Common\Util;

use Doctrine\Common\Inflector\Inflector as BaseInflector;
use function trigger_error;
use const E_USER_DEPRECATED;

@trigger_error(Inflector::class . ' is deprecated.', E_USER_DEPRECATED);

/**
* Doctrine inflector has static methods for inflecting text.
Expand Down
3 changes: 3 additions & 0 deletions tests/Doctrine/Tests/Common/ClassLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Doctrine\Common\ClassLoader;

/**
* @group legacy
*/
class ClassLoaderTest extends \Doctrine\Tests\DoctrineTestCase
{
public function testClassLoader()
Expand Down

0 comments on commit 39bc396

Please sign in to comment.