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

Address deprecations from persistence #2150

Merged

Conversation

greg0ire
Copy link
Member

Q A
Type bug
BC Break no
Fixed issues n/a

Summary

A backwards-compatibility layer has been added to persistence to help
consumers move to the new namespacing. It is based on class aliases,
which means the type declaration changes should not be a BC-break: types
are the same.
See doctrine/persistence#71

This means:

  • using the new namespaces
  • adding autoload calls for new types to types that may be extended and
    use persistence types in type declarations of non-constructor methods,
    so that signature compatibility is recognized by old versions of php.
    More details on this at
    https://dev.to/greg0ire/how-to-deprecate-a-type-in-php-48cf

@greg0ire greg0ire force-pushed the address-deprecations-from-persistence branch from db88e53 to b159e4b Compare January 10, 2020 21:56
@greg0ire
Copy link
Member Author

The build fails because persistence requires php 7.1 . Could we drop php 7.0?

@malarzm malarzm added the Task label Jan 10, 2020
@malarzm malarzm added this to the 2.1.0 milestone Jan 10, 2020
@malarzm malarzm added this to In progress in ODM 2.1 via automation Jan 10, 2020
@malarzm
Copy link
Member

malarzm commented Jan 10, 2020

I think we can safely do that in 2.1 👍

@greg0ire
Copy link
Member Author

🤔 why not 2.0.4 ? Also, should we forbid persistence 1.4 and up on this branch? That way people don't get deprecations they cannot fix?

@malarzm
Copy link
Member

malarzm commented Jan 10, 2020

Oh this is targeting 1.3.x... Here we're still allowing 5.6 so no way we can bump to 7.1. I guess with deprecations from the common it'll be one more poke for folks to upgrade ODM to 2.x.

why not 2.0.4 ?

PHP version can be bumped in a minor release, we even made a blog post about it :) https://www.doctrine-project.org/2017/07/25/php-7.1-requirement-and-composer.html

@greg0ire
Copy link
Member Author

But… 2.0.x already requires 7.2, doesn't it?

@malarzm malarzm removed this from In progress in ODM 2.1 Jan 11, 2020
@malarzm malarzm modified the milestones: 2.1.0, 2.0.4 Jan 11, 2020
@malarzm
Copy link
Member

malarzm commented Jan 11, 2020

Yeah, this is what happens when I'm replying in the night. I'm sorry @greg0ire you're right, we can totally include this in 2.0.4. I was confused by you saying we need to drop 7.0 and thought 2.0 is still supporting that version.

@greg0ire greg0ire changed the base branch from 1.3.x to 2.0.x January 11, 2020 12:39
@greg0ire greg0ire force-pushed the address-deprecations-from-persistence branch 3 times, most recently from 332138b to ea62187 Compare January 11, 2020 13:10
The persistence part of the common library has been extracted in a
separate library.
@greg0ire greg0ire force-pushed the address-deprecations-from-persistence branch 2 times, most recently from 38aca92 to f1eb2af Compare January 11, 2020 13:16
A backwards-compatibility layer has been added to persistence to help
consumers move to the new namespacing. It is based on class aliases,
which means the type declaration changes should not be a BC-break: types
are the same.
See doctrine/persistence#71

This means:
- using the new namespaces
- adding autoload calls for new types to types that may be extended and
use persistence types in type declarations of non-constructor methods,
so that signature compatibility is recognized by old versions of php.
More details on this at
https://dev.to/greg0ire/how-to-deprecate-a-type-in-php-48cf
@greg0ire greg0ire force-pushed the address-deprecations-from-persistence branch from f1eb2af to 3a23dde Compare January 11, 2020 13:28
@greg0ire
Copy link
Member Author

There! Got it to a mergeable state again :P

@malarzm malarzm merged commit 9bb6593 into doctrine:2.0.x Jan 13, 2020
@alcaeus
Copy link
Member

alcaeus commented Jan 13, 2020

Thanks @greg0ire!

@greg0ire greg0ire deleted the address-deprecations-from-persistence branch January 13, 2020 17:57
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.

None yet

5 participants