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

DevKit updates for 4.x branch #779

Merged
merged 2 commits into from
Aug 29, 2022
Merged

DevKit updates for 4.x branch #779

merged 2 commits into from
Aug 29, 2022

Conversation

SonataCI
Copy link
Collaborator

@SonataCI SonataCI commented Aug 29, 2022

Changelog

### Added
- Generics to ProxyQuery and ProxyQueryInterface

@jordisala1991 jordisala1991 force-pushed the 4.x-dev-kit branch 6 times, most recently from 9e293e3 to 41fb6f9 Compare August 29, 2022 09:54
@@ -57,9 +60,6 @@ public function __clone()
$this->queryBuilder = clone $this->queryBuilder;
}

/**
* @return Iterator<object>
Copy link
Member

Choose a reason for hiding this comment

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

wdyt about this alternative @VincentLanglet ? the typehint for execute is already on the parent and it is already iterable so I don't think we need to add this.

Copy link
Member

Choose a reason for hiding this comment

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

That's a solution until doctrine/mongodb-odm#2457 indeed.

@@ -119,8 +119,8 @@ public function testExecuteAllowsSorting(): void
$proxyQuery->setSortBy([], ['fieldName' => 'name']);
$proxyQuery->setSortOrder('DESC');

/** @var array{array{name: string}} $result */
$result = $proxyQuery->execute()->toArray();
/** @var iterable<array{name: string}> $result */
Copy link
Member

Choose a reason for hiding this comment

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

If you typehint the ProxyQuery as ProxyQuery<array{name: string}> you won't have to typehint the result.

@@ -143,23 +143,26 @@ public function testExecuteAllowsSortingWithEmbedded(): void
$proxyQuery->setSortBy([['fieldName' => 'embeddedDocument']], ['fieldName' => 'position']);
$proxyQuery->setSortOrder('DESC');

/** @var array{array{name: string}} $result */
$result = $proxyQuery->execute()->toArray();
/** @var iterable<array{name: string}> $result */
Copy link
Member

Choose a reason for hiding this comment

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

same

@VincentLanglet
Copy link
Member

The changelog from #778 should be added to this PR

@jordisala1991
Copy link
Member

Done

@VincentLanglet VincentLanglet merged commit 9e828fc into 4.x Aug 29, 2022
@VincentLanglet VincentLanglet deleted the 4.x-dev-kit branch August 29, 2022 11:49
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