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

Make CompositeExpression immutable #3858

Merged
merged 1 commit into from
Jan 30, 2020

Conversation

BenMorel
Copy link
Contributor

Continuing the work in #3850.

@BenMorel
Copy link
Contributor Author

@morozov BTW, should this be targeting 3.0 or 4.0? I can see all these breaking changes in the UPGRADE file targeting 3.0, but IIRC you said that there would not be large BC breaks in 3.0? Did I understand this right?

@morozov
Copy link
Member

morozov commented Jan 29, 2020

These changes should be targeting master (4.0). The upgrade notes in master should be corrected have two different sections for 3.0 and 4.0.

@BenMorel
Copy link
Contributor Author

Do you mean that some of the changes marked as 3.0 in the UPGRADE file should target 4.0? Should you update this file first?

@@ -43,51 +47,10 @@ class CompositeExpression implements Countable
*/
public function __construct(string $type, array $parts = [])
Copy link
Member

Choose a reason for hiding this comment

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

In a future PR, I'd like the constructor to be made private in favor of two named constructors — and() and or() — which would accept ($part, ...$parts) and therefore not allow construction of an empty composite expression.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've mentioned that this is temporary in #3850 (comment). I'd like to complete immutability first, then move on to stop accepting empty parts. And you're right, factory methods will be a good idea!

@morozov
Copy link
Member

morozov commented Jan 30, 2020

Do you mean that some of the changes marked as 3.0 in the UPGRADE file should target 4.0?

Yes.

Should you update this file first?

#3859

@morozov morozov merged commit 28fa940 into doctrine:master Jan 30, 2020
@morozov
Copy link
Member

morozov commented Jan 30, 2020

Thanks, @BenMorel!

@morozov morozov self-assigned this Jan 30, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants