Skip to content

Address deprecations from persistence#7953

Merged
beberlei merged 1 commit intodoctrine:2.7from
greg0ire:address-persistence-deprecations
May 7, 2020
Merged

Address deprecations from persistence#7953
beberlei merged 1 commit intodoctrine:2.7from
greg0ire:address-persistence-deprecations

Conversation

@greg0ire
Copy link
Member

@greg0ire greg0ire commented Dec 12, 2019

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

How can I test this on my project?

composer config repositories.greg0ire vcs https://github.com/greg0ire/doctrine-orm
composer require doctrine/orm "dev-address-persistence-deprecations as v2.7.0"

@greg0ire greg0ire force-pushed the address-persistence-deprecations branch 3 times, most recently from 33c9fe3 to 788b5d8 Compare December 12, 2019 18:48
@greg0ire greg0ire changed the title Address deprecations from persistence WIP: Address deprecations from persistence Dec 12, 2019
@greg0ire greg0ire force-pushed the address-persistence-deprecations branch 3 times, most recently from 271a2ec to b3a221c Compare December 12, 2019 19:21
@greg0ire greg0ire changed the title WIP: Address deprecations from persistence Address deprecations from persistence Dec 12, 2019
@greg0ire greg0ire force-pushed the address-persistence-deprecations branch from b3a221c to 3d9483f Compare December 12, 2019 19:55
@greg0ire greg0ire changed the base branch from 2.8.x to 2.7 December 12, 2019 19:55
alcaeus
alcaeus previously approved these changes Dec 12, 2019
@alcaeus alcaeus self-assigned this Dec 12, 2019
@alcaeus alcaeus added the Bug label Dec 12, 2019
@greg0ire greg0ire changed the title Address deprecations from persistence WIP: Address deprecations from persistence Dec 12, 2019
@greg0ire greg0ire force-pushed the address-persistence-deprecations branch 8 times, most recently from 4c6ee4e to 2905823 Compare December 12, 2019 22:15
@greg0ire greg0ire changed the title WIP: Address deprecations from persistence Address deprecations from persistence Dec 13, 2019
@greg0ire greg0ire force-pushed the address-persistence-deprecations branch from 2905823 to a19296a Compare December 13, 2019 07:33
alcaeus
alcaeus previously approved these changes Dec 13, 2019
Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

LGTM. @nicolas-grekas do you want to give this another look before we merge it?

@greg0ire greg0ire force-pushed the address-persistence-deprecations branch 3 times, most recently from d76a879 to 5c71e38 Compare December 14, 2019 11:17
@nicolas-grekas
Copy link
Member

Yes, can't say otherwise...
TIme to merge here? @greg0ire, rebase needed :)

@alcaeus
Copy link
Member

alcaeus commented Mar 4, 2020

TIme to merge here?

Absolutely. Ping @beberlei - any chance we can move this into 2.7.2?

@greg0ire greg0ire force-pushed the address-persistence-deprecations branch from 29de7bb to 3482fc7 Compare March 4, 2020 23:25
@greg0ire
Copy link
Member Author

greg0ire commented Mar 4, 2020

Rebased. IMO we should release persistence 2 with only the removal of the BC layer, allow it in all consuming packages, release said packages, and then require it in all consuming packages, removing BC layers in these packages at that moment, in quick succession. I know Doctrine is against bumping a major version of persistence in a minor, but maybe if we are changing our workflow towards majors that are less painful to upgrade to this could re-considered.

@greg0ire greg0ire force-pushed the address-persistence-deprecations branch from 3482fc7 to 4a068ec Compare March 21, 2020 13:07
@func0der
Copy link

I really appreciate all the hard work that went into this.

Do we have a timetable on this?
The split of doctrine/common and the use of class_alias actually do break code, because it can not ber properly parsed by php parsers (e.g. nikic/php-parser and furthermore goaop/parser-reflection). This might be just one of the problems, that is out there as other might still hold them back with "doctrine/common": "^2.8 <2.9", :D

How can we help to give this a go?

@greg0ire greg0ire force-pushed the address-persistence-deprecations branch from 4a068ec to 2403c08 Compare May 6, 2020 16:34
@greg0ire greg0ire changed the base branch from 2.8.x to 2.7 May 6, 2020 16:35
@greg0ire greg0ire dismissed stale reviews from alcaeus, SenseException, and nicolas-grekas May 6, 2020 16:35

The base branch was changed.

@greg0ire greg0ire closed this May 6, 2020
@greg0ire greg0ire reopened this May 6, 2020
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-persistence-deprecations branch from 2403c08 to bd8e7b9 Compare May 6, 2020 17:26
@beberlei beberlei merged commit 8a9954e into doctrine:2.7 May 7, 2020
@greg0ire greg0ire deleted the address-persistence-deprecations branch May 7, 2020 06:40
@alcaeus alcaeus modified the milestones: 2.8.0, 2.7.3 May 7, 2020
greg0ire added a commit to greg0ire/symfony that referenced this pull request May 7, 2020
…ctrine/orm"

This reverts commit 9d0a705.
The doctrine/persistence deprecations has been addressed uptream, see
doctrine/orm#7953
nicolas-grekas added a commit to symfony/symfony that referenced this pull request May 8, 2020
…ire)

This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

Remove patches for Doctrine bugs and deprecations

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

This PR removes patches put in place because of a bug fixed in doctrine/dbal#3994, and because of deprecations addressed in doctrine/orm#7953

Commits
-------

2f305cd Remove patches for Doctrine bugs and deprecations
mbessolov added a commit to mbessolov/doctrine-extensions that referenced this pull request Dec 16, 2020
+ Added more PHP versions.
+ Fixed .travis.yml syntax deprecations.
+ Restricted doctrine/common: <3.0.0 in require-dev for now (doctrine/orm#7953).
mbessolov added a commit to mbessolov/doctrine-extensions that referenced this pull request Dec 17, 2020
+ Added more PHP versions (except for 7.3 - oroinc#73)
+ Fixed .travis.yml syntax deprecations.
+ Restricted doctrine/common: <3.0.0 in require-dev for now (doctrine/orm#7953).
mbessolov added a commit to mbessolov/doctrine-extensions that referenced this pull request Dec 17, 2020
+ Added more PHP versions (except for 7.3 - oroinc#73)
+ Fixed .travis.yml syntax deprecations.
+ Restricted doctrine/common: <3.0.0 in require-dev for now (doctrine/orm#7953).
mbessolov added a commit to mbessolov/doctrine-extensions that referenced this pull request Dec 17, 2020
+ Added more PHP versions (except for 7.3 and 7.4 - oroinc#73)
+ Fixed .travis.yml syntax deprecations.
+ Restricted doctrine/common: <3.0.0 in require-dev for now (doctrine/orm#7953).
Gwemox pushed a commit to mon-petit-placement/doctrine-extensions that referenced this pull request Apr 24, 2024
+ Added more PHP versions (except for 7.3 and 7.4 - oroinc#73)
+ Fixed .travis.yml syntax deprecations.
+ Restricted doctrine/common: <3.0.0 in require-dev for now (doctrine/orm#7953).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.