-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
EntityManagerInterface $em, | ||
ClassMetadata $class, | ||
private readonly ClassMetadata|null $typeClass, | ||
Collection $collection, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
lib/Doctrine/ORM/Query/Printer.php
Outdated
*/ | ||
public function __construct($silent = false) | ||
public function __construct(protected $_silent = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #10500
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
lib/Doctrine/ORM/Query/Printer.php
Outdated
*/ | ||
public function __construct($silent = false) | ||
public function __construct(protected $_silent = false) |
There was a problem hiding this comment.
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.
2e4d671
to
941292f
Compare
feedback has been addressed.
No description provided.