Skip to content

Commit 3f61888

Browse files
authored
Merge pull request #59 from aternosorg/fix-query-result-generics
Fix PHPDoc generics for query results and model collections
2 parents 3aa8c91 + bb2fd24 commit 3f61888

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎src/GenericModel.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public static function get(string $id, bool $update = false, bool $saveToRegistr
456456
* Query the model
457457
*
458458
* @param Query $query
459-
* @return QueryResult<static>|static[]
459+
* @return QueryResult<static>
460460
* @noinspection PhpDocSignatureInspection
461461
*/
462462
public static function query(Query $query): QueryResult
@@ -545,7 +545,7 @@ public static function query(Query $query): QueryResult
545545
* @param array|int|Limit|null $limit
546546
* @param array|GroupField[]|string[]|null $group
547547
* @param bool $saveResultsToRegistry Whether results of this query should be saved in the model registry.
548-
* @return QueryResult<static>|static[]
548+
* @return QueryResult<static>
549549
* @throws ModelException
550550
* @noinspection PhpDocSignatureInspection
551551
*/
@@ -580,7 +580,7 @@ public static function count(null|WhereCondition|array|WhereGroup $where = null)
580580
* @param array|null|WhereCondition|WhereGroup $where
581581
* @param array|null $order
582582
* @param array|int|Limit|null $limit
583-
* @return QueryResult<static>|static[]
583+
* @return QueryResult<static>
584584
* @noinspection PhpDocSignatureInspection
585585
*/
586586
public static function update(null|array $fields = null,
@@ -682,7 +682,7 @@ public function delete(): bool
682682
* dataset
683683
*
684684
* @param array $data
685-
* @return QueryResult<static>|static[]
685+
* @return QueryResult<static>
686686
* @noinspection PhpDocSignatureInspection
687687
*/
688688
public function set(array $data): QueryResult

‎src/ModelCollection.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Class ModelCollection
1111
*
1212
* @template TModel of ModelInterface
13+
* @implements Iterator<int, TModel>
14+
* @implements ArrayAccess<int, TModel>
1315
* @package Aternos\Model
1416
*/
1517
class ModelCollection implements Iterator, Countable, ArrayAccess

0 commit comments

Comments
 (0)