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 remaining exceptions to PHP 8 syntax #10402

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

greg0ire
Copy link
Member

No description provided.

derrabus
derrabus previously approved these changes Jan 14, 2023
*/
public static function newEntityFoundThroughRelationship(array $associationMapping, $entry)
/** @psalm-param array<string, string> $associationMapping */
public static function newEntityFoundThroughRelationship(array $associationMapping, object $entry): ORMInvalidArgumentException
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 static function newEntityFoundThroughRelationship(array $associationMapping, object $entry): ORMInvalidArgumentException
public static function newEntityFoundThroughRelationship(array $associationMapping, object $entry): self

Can we enforce this via PHPCS, btw?

Copy link
Member Author

Choose a reason for hiding this comment

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

@kukulich hi 👋 ! Would you maybe know about this?

Choose a reason for hiding this comment

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

I think it's solved by Squiz.Classes.SelfMemberReference

Choose a reason for hiding this comment

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

Hmm, probably not, because the sniff is used in Doctrine CS :(

Choose a reason for hiding this comment

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

It looks I'll have to write the sniff :)

* @return ORMInvalidArgumentException
*/
public static function detachedEntityFoundThroughRelationship(array $assoc, $entry)
/** @psalm-param array<string, string> $assoc */
Copy link
Member

Choose a reason for hiding this comment

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

Probably something we should fix on a lower branch: The method has a pretty strong opinion on which keys should be defined on that array. It might be worth either documenting the shape or splitting $assoc into three (?) parameters.

@derrabus
Copy link
Member

Rebase needed.

@greg0ire
Copy link
Member Author

🤦 sorry

@derrabus derrabus added this to the 3.0.0 milestone Jan 18, 2023
@derrabus derrabus merged commit 4c1e520 into doctrine:3.0.x Jan 18, 2023
@greg0ire greg0ire deleted the php8-migration branch January 18, 2023 16:14
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