Skip to content

Commit

Permalink
Remove return type hints to avoid confusion
Browse files Browse the repository at this point in the history
Code analyzers don't understand when we overwrite return
type hints in generated repositories, so we avoid the
return type hints alltogether. They don't serve much
purpose anyway.
  • Loading branch information
iquito committed Apr 29, 2019
1 parent 01fded3 commit b0e58e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/Action/SelectEntries.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ public function blocking(bool $active = true): self
/**
* Execute SELECT query and return a list of objects that matched it
*
* @return object[]
* Returns object[] (from the entity class), we avoid the return type hint
* here to code analyzers don't get confused by generated repositories
* and their different type hint
*/
public function getAllEntries(): array
{
Expand All @@ -119,7 +121,9 @@ public function getAllEntries(): array
/**
* Execute SELECT query and return exactly one entry, if one was found at all
*
* @return object|null
* Returns object (from the entity class) or null if no entry was found, we avoid
* the return type hint here to code analyzers don't get confused by
* generated repositories and their different type hint
*/
public function getOneEntry()
{
Expand Down
6 changes: 5 additions & 1 deletion src/Action/SelectIteratorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ trait SelectIteratorTrait
private $lastResult;

/**
* @return object|array|null
* SelectEntries: Returns the entity object or null
* MultiSelectEntries: Return an array with a result entry or null
*
* We avoid the return type hint here so code analyzers don't get
* confused by generated repositories and their different type hint
*/
public function current()
{
Expand Down

0 comments on commit b0e58e7

Please sign in to comment.