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

Migrate more classes to PHP 8 syntax #10497

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented Feb 5, 2023

No description provided.

Comment on lines 86 to 88
EntityManagerInterface $em,
ClassMetadata $class,
private readonly ClassMetadata|null $typeClass,
Collection $collection,
Copy link
Member

Choose a reason for hiding this comment

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

$em and $collection could also use constructor promotion.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so: $em is not supposed to be passed as null, but can become null on unserialization. $collection is a property inherited from the parent.

*/
public function __construct($silent = false)
public function __construct(protected $_silent = false)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public function __construct(protected $_silent = false)
public function __construct(protected bool $_silent = false)

The PR is already labeled as a BC break. Isn't this also a good time to remove the underscore prefix?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will do a separate, global PR if you don't mind.

Copy link
Member Author

Choose a reason for hiding this comment

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

See #10500

Copy link
Member

Choose a reason for hiding this comment

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

I think we've discussed similar changes already: I wouldn't switch parameter names to the discouraged underscore notation just for the sake of using CPP.

Copy link
Member Author

Choose a reason for hiding this comment

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

Then approve #10500. Or approve this one and let me rebase #10500, the end result will be the same: CPP and no underscore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I just pushed a version with no underscores so that we can deal with both PRs separately. More simple for everyone.

*/
public function __construct($silent = false)
public function __construct(protected $_silent = false)
Copy link
Member

Choose a reason for hiding this comment

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

I think we've discussed similar changes already: I wouldn't switch parameter names to the discouraged underscore notation just for the sake of using CPP.

@greg0ire greg0ire dismissed SenseException’s stale review February 6, 2023 22:26

feedback has been addressed.

@greg0ire greg0ire merged commit 7f9827d into doctrine:3.0.x Feb 6, 2023
@greg0ire greg0ire deleted the php8-migration branch February 6, 2023 22:26
@greg0ire greg0ire added this to the 3.0.0 milestone Feb 6, 2023
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