Skip to content
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

Add deprecation layers #1924

Merged
merged 6 commits into from
Jan 10, 2019
Merged

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Jan 9, 2019

Q A
Type improvement
BC Break no

Summary

Note: PR is best reviewed commit-by-commit.

This PR brings in a first round of deprecations:

I might have to revisit the BC layer for ClassMetadata once again. @greg0ire has tried the same for ORM in doctrine/orm#6886. What I'd like to do: trigger a deprecation notice when someone uses ClassMetadataInfo but allow using ClassMetadata in place of it. Using class_alias in ClassMetadata.php means that we can't trigger a deprecation notice. We might have to split this out of this PR.

@alcaeus alcaeus added the Feature label Jan 9, 2019
@alcaeus alcaeus added this to the 1.3.0 milestone Jan 9, 2019
@alcaeus alcaeus self-assigned this Jan 9, 2019
@greg0ire
Copy link
Member

greg0ire commented Jan 9, 2019

See also: https://dev.to/greg0ire/how-to-deprecate-a-type-in-php-48cf

Using class_alias in ClassMetadata.php means that we can't trigger a deprecation notice.

You actually can, but conditionally.

@malarzm
Copy link
Member

malarzm commented Jan 9, 2019

I'll take your word for ClassMetadata stuff, rest looks ok to me except for invalid schema that fails some tests :)

@alcaeus alcaeus force-pushed the add-deprecation-layers branch from f8a2964 to 4068402 Compare January 10, 2019 07:38
@alcaeus
Copy link
Member Author

alcaeus commented Jan 10, 2019

@greg0ire updated code with your suggestions and changed ClassMetadataInfo deprecation to follow the advice in your blog post. Could you take another look and see if you spot anything that seems wrong?

@alcaeus alcaeus force-pushed the add-deprecation-layers branch from 4068402 to 943667f Compare January 10, 2019 14:25
@alcaeus
Copy link
Member Author

alcaeus commented Jan 10, 2019

@greg0ire updated the comment to add both reasons.

@alcaeus alcaeus merged commit 058e09a into doctrine:1.3.x Jan 10, 2019
@alcaeus alcaeus deleted the add-deprecation-layers branch January 10, 2019 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants