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

Improve phpdoc specification #2312

Merged
merged 1 commit into from
May 31, 2021
Merged

Conversation

franmomu
Copy link
Contributor

Q A
Type improvement
BC Break no
Fixed issues

Summary

These changes add more specific return type declaration as the ORM:

https://github.com/doctrine/orm/blob/a6577b89a2b028b79550ef58d9f272debdd75da4/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L58-L60
https://github.com/doctrine/orm/blob/a6577b89a2b028b79550ef58d9f272debdd75da4/lib/Doctrine/ORM/EntityManager.php#L758-L759

These changes fixes some issues on tests directory like:

$class = $this->factory->getMetadataFor(ShardedSubclass::class);
$this->assertTrue($class->isSharded());

isSharded is only available in ClassMetadata from this package or

$query = $this->dm->getRepository(User::class)
->createQueryBuilder()
->getQuery();

createQueryBuilder not available in ObjectRepository but DocumentRepository.

@alcaeus alcaeus self-assigned this May 31, 2021
@alcaeus alcaeus added this to the 2.3.0 milestone May 31, 2021
@alcaeus alcaeus merged commit 993288d into doctrine:2.3.x May 31, 2021
@alcaeus
Copy link
Member

alcaeus commented May 31, 2021

Thanks @franmomu!

@franmomu franmomu deleted the improve_phpdoc branch May 31, 2021 08:33
@alcaeus alcaeus modified the milestones: 2.3.0-alpha1, 2.3.0 Sep 9, 2021
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.

2 participants