Skip to content

Commit

Permalink
Merge pull request #845 from Majkl578/deprecations
Browse files Browse the repository at this point in the history
doctrine/common deprecations (soft)
  • Loading branch information
Ocramius committed Jun 24, 2018
2 parents 3666662 + 39bc396 commit 6e2d622
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 2 deletions.
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
7 changes: 6 additions & 1 deletion 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 All @@ -13,7 +18,7 @@
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*
* @deprecated the ClassLoader is deprecated and will be removed in version 3.0 of doctrine/common.
* @deprecated The ClassLoader is deprecated and will be removed in version 3.0 of doctrine/common.
*/
class ClassLoader
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Common/CommonException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Base exception class for package Doctrine\Common.
*
* @author heinrich
*
* @deprecated The doctrine/common package is deprecated, please use specific packages and their exceptions instead.
*/
class CommonException extends \Exception
{
Expand Down
6 changes: 6 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 All @@ -13,6 +17,8 @@
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*
* @deprecated Use Doctrine\Common\Lexer\AbstractLexer from doctrine/lexer package instead.
*/
abstract class Lexer extends AbstractLexer
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Common/Proxy/AbstractProxyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* Abstract factory for proxy objects.
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
*
* @deprecated The Doctrine\Common\Proxy component is deprecated, please use ocramius/proxy-manager instead.
*/
abstract class AbstractProxyFactory
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/Common/Proxy/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
* Special Autoloader for Proxy classes, which are not PSR-0 compliant.
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
*
* @internal
*
* @deprecated The Doctrine\Common\Proxy component is deprecated, please use ocramius/proxy-manager instead.
*/
class Autoloader
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* @link www.doctrine-project.org
* @since 2.4
* @author Marco Pivetta <ocramius@gmail.com>
*
* @deprecated The Doctrine\Common\Proxy component is deprecated, please use ocramius/proxy-manager instead.
*/
class InvalidArgumentException extends BaseInvalidArgumentException implements ProxyException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
* @link www.doctrine-project.org
* @author Fredrik Wendel <fredrik_w@users.sourceforge.net>
*
* @deprecated The Doctrine\Common\Proxy component is deprecated, please use ocramius/proxy-manager instead.
*/
class OutOfBoundsException extends BaseOutOfBoundsException implements ProxyException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Common/Proxy/Exception/ProxyException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* @link www.doctrine-project.org
* @since 2.4
* @author Marco Pivetta <ocramius@gmail.com>
*
* @deprecated The Doctrine\Common\Proxy component is deprecated, please use ocramius/proxy-manager instead.
*/
interface ProxyException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @link www.doctrine-project.org
* @since 2.4
* @author Marco Pivetta <ocramius@gmail.com>
*
* @deprecated The Doctrine\Common\Proxy component is deprecated, please use ocramius/proxy-manager instead.
*/
class UnexpectedValueException extends BaseUnexpectedValueException implements ProxyException
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Common/Proxy/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* @author Roman Borschel <roman@code-factory.org>
* @author Marco Pivetta <ocramius@gmail.com>
* @since 2.4
*
* @deprecated The Doctrine\Common\Proxy component is deprecated, please use ocramius/proxy-manager instead.
*/
interface Proxy extends BaseProxy
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Common/Proxy/ProxyDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Definition structure how to create a proxy.
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
*
* @deprecated The Doctrine\Common\Proxy component is deprecated, please use ocramius/proxy-manager instead.
*/
class ProxyDefinition
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Common/Proxy/ProxyGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*
* @author Marco Pivetta <ocramius@gmail.com>
* @since 2.4
*
* @deprecated The Doctrine\Common\Proxy component is deprecated, please use ocramius/proxy-manager instead.
*/
class ProxyGenerator
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Common/Util/ClassUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Johannes Schmitt <schmittjoh@gmail.com>
*
* @deprecated The ClassUtils class is deprecated.
*/
class ClassUtils
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Common/Util/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
* @author Giorgio Sironi <piccoloprincipeazzurro@gmail.com>
*
* @deprecated The Debug class is deprecated, please use symfony/var-dumper instead.
*/
final class Debug
{
Expand Down
6 changes: 6 additions & 0 deletions lib/Doctrine/Common/Util/Inflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
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.
*
* Kept for backwards compatibility reasons, was moved to its own component.
*
* @deprecated The Inflector class is deprecated, use Doctrine\Common\Inflector\Inflector from doctrine/inflector package instead,
*/
class Inflector extends BaseInflector
{
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Common/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*
* @deprecated The Version class is deprecated, please refrain from checking the version of doctrine/common.
*/
class Version
{
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 6e2d622

Please sign in to comment.