Skip to content

[2.7] adds deprecation notices. #13060

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 13 commits into from
Jan 5, 2015
Merged

Conversation

hhamon
Copy link
Contributor

@hhamon hhamon commented Dec 21, 2014

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #12608, #12672, #12675 #12684, #12686
License MIT
Doc PR ~

@hhamon hhamon force-pushed the deprecation-notices branch 5 times, most recently from ce0930c to 1359afb Compare December 21, 2014 15:26
@hhamon hhamon changed the title [2.7] [WIP] adds deprecation notices. [2.7] adds deprecation notices. Dec 21, 2014
@hhamon hhamon force-pushed the deprecation-notices branch from 1359afb to 940da08 Compare December 21, 2014 15:43
$constraint->type = 'isbn13';
if (null == $this->type) {
if ($this->isbn10 && !$this->isbn13) {
trigger_error('The "isbn10" option of the Isbn constraint is deprecated since version 2.5 and will be removed in 3.0. Use the "type" option instead.', E_USER_DEPRECATED);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO this should go into the Isbn class.

@nicolas-grekas
Copy link
Member

Rebase needed.
If you want to add notices for deprecated constants in this PR also, here is how:
#12968 (diff)

(e.g. Symfony\Component\Debug\ErrorHandler::TYPE_DEPRECATION)

@hhamon hhamon force-pushed the deprecation-notices branch 2 times, most recently from ef08363 to 2e35356 Compare December 23, 2014 12:30
@hhamon
Copy link
Contributor Author

hhamon commented Dec 23, 2014

This PR has been rebased. Let's see what Travis says now.

@hhamon hhamon force-pushed the deprecation-notices branch 4 times, most recently from 9f65033 to baa9163 Compare December 26, 2014 09:53
@hhamon
Copy link
Contributor Author

hhamon commented Dec 26, 2014

Tests are green from 5.3.3 to 5.6 but the matrix still reports failures on components low and high.

@hhamon
Copy link
Contributor Author

hhamon commented Dec 26, 2014

It seems failing tests are due to PHPUnit.

@hhamon hhamon force-pushed the deprecation-notices branch 4 times, most recently from 5320819 to d6f28ae Compare December 26, 2014 15:15
@hhamon
Copy link
Contributor Author

hhamon commented Dec 26, 2014

Yeah test suite is finally green! Thanks @nicolas-grekas. Ping @fabpot

@hhamon hhamon force-pushed the deprecation-notices branch 2 times, most recently from 0d623e4 to 616de96 Compare December 26, 2014 16:01
@hhamon hhamon changed the title [2.7] adds deprecation notices. [2.7] [WIP] adds deprecation notices. Dec 26, 2014
@hhamon
Copy link
Contributor Author

hhamon commented Dec 26, 2014

Even though tests are passing, this PR is still a WIP as some deprecation messages still need to be normalized.

* The {@link Symfony\Component\Form\Util\InheritDataAwareIterator::__construct} method
* forces this argument to false.
*/
if ($triggerDeprecationNotice) {
Copy link
Member

Choose a reason for hiding this comment

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

instead of adding an extra argument, it would be more reliable to use get_class($this) === __CLASS__ given that our use case for avoiding the trigger is for the child class.

@hhamon hhamon force-pushed the deprecation-notices branch from 2806171 to cd96ff9 Compare January 4, 2015 12:42
@@ -20,7 +20,7 @@
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated Deprecated in 2.2, to be removed in 3.0.
* @deprecated since version 2.2, to be removed in 3.0.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stof @fabpot is the class still considered deprecated or only the construct method arguments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like it is as per b957f44. The strange thing is the introduced deprecation notice in the construct method saying passing a ContainerInterface instance is deprecated since version 2.7 and will be removed in 3.0. The whole class is already deprecated and will be removed in 3.0, which is confusing.

Copy link
Member

Choose a reason for hiding this comment

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

The whole class was deprecated in 2.2. I changed the constructor argument in 2.7. But anyway, nobody should use this class and it will be removed in 3.0. See #13233

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok thanks.

@hhamon hhamon force-pushed the deprecation-notices branch from cd96ff9 to f9fbb4f Compare January 5, 2015 15:02
@nicolas-grekas
Copy link
Member

I tested this PR locally after rebasing it on latest 2.7, tests are green.
There is one minor conflict in src/Symfony/Component/Validator/Mapping/TraversalStrategy.php that I resolved like this:

     * @deprecated since version 2.5, to be removed in 3.0.
     *             This constant was added for backward compatibility only.
     * @internal

👍 from me. There are places where we'll need to remove/update some deprecation triggers and adding all of them like done here will allow us to see where. I'll enhance the deprecation summary once this gets merged so we can start by the most complaining triggers.

@fabpot
Copy link
Member

fabpot commented Jan 5, 2015

Thank you @hhamon.

@fabpot fabpot merged commit f9fbb4f into symfony:2.7 Jan 5, 2015
fabpot added a commit that referenced this pull request Jan 5, 2015
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] adds deprecation notices.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #12608, #12672, #12675 #12684, #12686
| License       | MIT
| Doc PR        | ~

Commits
-------

f9fbb4f Fixes more deprecation notices as per @stof review.
fd47c07 Fixed some deprecations according to @stof feedbacks.
2a3e7d2 Normalizes deprecation notice messages.
738b9be [Validator] fixes UuidValidator deprecated class namespace.
e608ba6 [Form] adds more deprecation notices.
cd9617a [Validator] adds more deprecation notices.
a7f841e [Form] Adds a way to trigger deprecation notice on demand for VirtualFormAwareIterator class.
97efd2c Fixes more deprecation notices.
fd9c7bb Normalized @deprecated annotations.
39cfd47 Removed deprecation notices from test files.
2a9749d Fixes deprecation notices.
6f57b7b Reverted trigger_error() function calls on deprecated interfaces to prevent breaking third party projects implementing them.
86b9f6b Adds deprecation notices for structures to be removed in 3.0.
@hhamon
Copy link
Contributor Author

hhamon commented Jan 5, 2015

Great to see that work merged. Let's see now how to handle all deprecations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants