8000 [Serializer] rename exception interface by nicolas-grekas · Pull Request #13798 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Serializer] rename exception interface #13798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions UPGRADE-2.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ Serializer
$normalizer = new GetSetMethodNormalizer(null, $nameConverter);
```

* `Symfony\Component\Serializer\Exception\ExceptionInterface` is the new name for the now
deprecated `Symfony\Component\Serializer\Exception\Exception` interface.

PropertyAccess
--------------

Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Serializer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CHANGELOG
* [DEPRECATION] `GetSetMethodNormalizer::setCamelizedAttributes()` and
`PropertyNormalizer::setCamelizedAttributes()` are replaced by
`CamelCaseToSnakeCaseNameConverter`
* [DEPRECATION] the `Exception` interface has been renamed to `ExceptionInterface`

2.6.0
-----
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Serializer/Exception/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Base exception.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
* @deprecated since version 2.7, to be removed in 3.0. Use ExceptionInterface instead.
*/
interface Exception
{
Expand Down
21 changes: 21 additions & 0 deletions src/Symfony/Component/Serializer/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Serializer\Exception;

/**
* Base exception interface.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface ExceptionInterface extends Exception
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be the other way around ? Exception extending the ExceptionInterface ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope: this way allows the best forward/backward compatibility

{
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class InvalidArgumentException extends \InvalidArgumentException implements Exception
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
*
* @author Lukas Kahwe Smith <smith@pooteeweet.org>
*/
class LogicException extends \LogicException implements Exception
class LogicException extends \LogicException implements ExceptionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class RuntimeException extends \RuntimeException implements Exception
class RuntimeException extends \RuntimeException implements ExceptionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
*
* @author Lukas Kahwe Smith <smith@pooteeweet.org>
*/
class UnexpectedValueException extends \UnexpectedValueException implements Exception
class UnexpectedValueException extends \UnexpectedValueException implements ExceptionInterface
{
}
0