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

refactor: changed types and annotations 3 #247

Open
wants to merge 2 commits into
base: v3.x
Choose a base branch
from

Conversation

aliceComH
Copy link

Este PR é o terceiro de um serie de PRs que tem por objetivo adicionar padroes de codigo ao mongolid.

As adições realizadas aqui estão sendo desmebradas do PR:
https://github.com/leroy-merlin-br/mongolid/pull/209/files#diff-44c6c764ba381928e3221e4690c18dc0fe596311af5b123d5d2089ffc4db52af

E são testadas no projeto : https://github.com/JoaoFerrazfs/Mongo-PHP-Docker_BaseProject

@aliceComH aliceComH self-assigned this Oct 6, 2024
JoaoFerrazfs
JoaoFerrazfs previously approved these changes Oct 7, 2024
@aliceComH aliceComH marked this pull request as ready for review October 8, 2024 19:02
Base automatically changed from refactor/change-types-and-annotations-2 to v3.x October 9, 2024 16:52
@JoaoFerrazfs JoaoFerrazfs dismissed their stale review October 9, 2024 16:52

The base branch was changed.

*/
protected function referencesMany(string $entity, string $field, bool $cacheable = true): CursorInterface
protected function referencesMany(string $entity, string $field, bool $cacheable = true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Return type is missing here

*/
protected function embedsMany(string $entity, string $field): CursorInterface
protected function embedsMany(string $entity, string $field)
Copy link
Contributor

Choose a reason for hiding this comment

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

Return type is missing here, too.

*/
private function getDocumentFromCache(ModelInterface $entityInstance, string $referencedId): mixed
private function getDocumentFromCache(ModelInterface $entityInstance, string $referencedId)
Copy link
Contributor

Choose a reason for hiding this comment

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

Return type is missing here, too.

@@ -267,7 +209,7 @@ public function getCollectionName(): string
throw new NoCollectionNameException();
}

return $this->getSchema()->collection;
return $this->collection ?: $this->getSchema()->collection;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return $this->collection ?: $this->getSchema()->collection;
return $this->getSchema()->collection;

I think it's better to keep the actual implementation because getSchema function can return a schema from fields too.

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.

4 participants