Skip to content

Commit

Permalink
fix: psalm typings in Select class
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed May 8, 2024
1 parent 30c76e7 commit 6218a49
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function __clone()
/**
* Create new Selector with applied scope. By default no scope used.
*
* @return Select<TEntity>
* @return static<TEntity>
*/
public function scope(ScopeInterface $scope = null): self
{
Expand Down Expand Up @@ -160,7 +160,7 @@ public function buildQuery(): SelectQuery
*
* @psalm-param string|int|list<string|int>|object ...$ids
*
* @return Select<TEntity>
* @return static<TEntity>
*/
public function wherePK(string|int|array|object ...$ids): self
{
Expand Down Expand Up @@ -195,7 +195,7 @@ public function count(string $column = null): int
}

/**
* @return Select<TEntity>
* @return static<TEntity>
*/
public function limit(int $limit): self
{
Expand All @@ -205,7 +205,7 @@ public function limit(int $limit): self
}

/**
* @return Select<TEntity>
* @return static<TEntity>
*/
public function offset(int $offset): self
{
Expand Down Expand Up @@ -267,7 +267,7 @@ public function offset(int $offset): self
*
* @see with()
*
* @return Select<TEntity>
* @return static<TEntity>
*/
public function load(string|array $relation, array $options = []): self
{
Expand Down Expand Up @@ -357,7 +357,7 @@ public function load(string|array $relation, array $options = []): self
*
* @see load()
*
* @return Select<TEntity>
* @return static<TEntity>
*/
public function with(string|array $relation, array $options = []): self
{
Expand Down Expand Up @@ -465,7 +465,7 @@ public function loadSubclasses(bool $load = true): self
* @param list<non-empty-string> $pk
* @param list<array|int|object|string> $args
*
* @return Select<TEntity>
* @return static<TEntity>
*/
private function buildCompositePKQuery(array $pk, array $args): self
{
Expand All @@ -481,7 +481,7 @@ private function buildCompositePKQuery(array $pk, array $args): self
);
}

$isAssoc = !array_is_list($values);
$isAssoc = !\array_is_list($values);
foreach ($values as $key => $value) {
if ($isAssoc && !\in_array($key, $pk, true)) {
throw new InvalidArgumentException(\sprintf('Primary key `%s` not found.', $key));
Expand Down

0 comments on commit 6218a49

Please sign in to comment.