Skip to content

Commit 8eeffd5

Browse files
committed
Fixed issues reported by phpstan
1 parent 8ae3342 commit 8eeffd5

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

src/Builder/Helpers/RecursiveStructureAccess.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class RecursiveStructureAccess {
88
/**
99
* @param object|array<string, mixed> $structure
10-
* @param string|array<int, string> $path
10+
* @param string|string[] $path
1111
* @return bool
1212
*/
1313
public static function recursiveHas($structure, $path): bool {
@@ -17,7 +17,7 @@ public static function recursiveHas($structure, $path): bool {
1717

1818
/**
1919
* @param object|array<string, mixed> $structure
20-
* @param string|array<int, string> $path
20+
* @param string|string[] $path
2121
* @param mixed $default
2222
* @return mixed
2323
*/
@@ -40,7 +40,7 @@ public static function recursiveGet($structure, $path, $default) {
4040

4141
/**
4242
* @param mixed $structure
43-
* @param array<int, string> $path
43+
* @param string[] $path
4444
* @return bool
4545
*/
4646
private static function _recursiveHas($structure, array $path): bool {
@@ -59,8 +59,8 @@ private static function _recursiveHas($structure, array $path): bool {
5959
}
6060

6161
/**
62-
* @param string|array<int, string> $path
63-
* @return array<int, string>
62+
* @param string|string[] $path
63+
* @return string[]
6464
*/
6565
private static function getArrayPath($path): array {
6666
if(is_array($path)) {

src/Builder/Insert.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ public function addOrUpdateExpr(string $expr, ...$args) {
129129

130130
/**
131131
* @param array<string, null|bool|int|float|string|DateTimeInterface> $data
132-
* @param array<int, string>|null $mask
133-
* @param array<int, string>|null $excludeFields
132+
* @param null|string[] $mask
133+
* @param null|string[] $excludeFields
134134
* @return $this
135135
*/
136136
public function addAll(array $data, ?array $mask = null, ?array $excludeFields = null) {
@@ -142,8 +142,8 @@ public function addAll(array $data, ?array $mask = null, ?array $excludeFields =
142142

143143
/**
144144
* @param array<string, null|bool|int|float|string|DateTimeInterface> $data
145-
* @param array<int, string>|null $mask
146-
* @param array<int, string>|null $excludeFields
145+
* @param null|string[] $mask
146+
* @param null|string[] $excludeFields
147147
* @return $this
148148
*/
149149
public function updateAll(array $data, ?array $mask = null, ?array $excludeFields = null) {
@@ -157,7 +157,7 @@ public function updateAll(array $data, ?array $mask = null, ?array $excludeField
157157

158158
/**
159159
* @param array<string, null|bool|int|float|string|DateTimeInterface> $data
160-
* @param array<int, string>|null $mask
160+
* @param null|string[] $mask
161161
* @param array<int, string>|null $excludeFields
162162
* @return $this
163163
*/

src/Builder/Internal/ConditionBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ public static function build(Database $db, string $query, array $conditions, str
3838
}
3939

4040
/**
41-
* @param array<int, string> $conditions
41+
* @param string[] $conditions
4242
* @param string $expression
4343
* @param array<int, null|string|array<int, null|scalar>|Builder\DBExpr|Builder\Select> $arguments
4444
* @param Database $db
45-
* @return array<int, string>
45+
* @return string[]
4646
*/
4747
private static function buildCondition(array $conditions, string $expression, array $arguments, Database $db): array {
4848
$expr = $db->quoteExpression($expression, $arguments);

src/Builder/RunnableSelect.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function setPreserveTypes(bool $preserveTypes = true);
4646
* @template K of int
4747
* @template V
4848
* @param null|callable(array<string, null|scalar>): (void|DBIgnoreRow|array<K, V>) $callback
49-
* @return ($callback is null ? array<int, array<int, null|scalar>> : array<int, array<K, V>>)
49+
* @return ($callback is null ? list<array<int, null|scalar>> : array<int, array<K, V>>)
5050
*/
5151
public function fetchIndexedRows($callback = null): array;
5252

@@ -62,7 +62,7 @@ public function fetchRows($callback = null): array;
6262
* @template K
6363
* @template V
6464
* @param null|callable(array<string, null|scalar>): (void|DBIgnoreRow|array<K, V>) $callback
65-
* @return ($callback is null ? Generator<int, array<string, mixed>> : Generator<int, array<K, V>>)
65+
* @return ($callback is null ? Generator<int, array<string, null|scalar>> : Generator<int, array<K, V>>)
6666
*/
6767
public function fetchRowsLazy($callback = null);
6868

src/Builder/Traits/GroupByBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
trait GroupByBuilder {
77
use AbstractDB;
88

9-
/** @var array<int, string> */
9+
/** @var string[] */
1010
private $groupBy = [];
1111

1212
/**

src/Databases/MySQL/MySQLRunnableSelect.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public function getIterator(): Traversable {
249249
}
250250

251251
/**
252-
* @template TFnReturnType of array<string, null|scalar>
252+
* @template TFnReturnType of array<int|string, mixed>
253253
* @param null|(callable(array<string, null|scalar>): (TFnReturnType|DBIgnoreRow|null|void)) $callback
254254
* @param int $mode
255255
* @param mixed $arg0
@@ -279,6 +279,7 @@ private function fetchAll($callback = null, int $mode = 0, $arg0 = null) {
279279
return $resultData;
280280
});
281281
}
282+
return $data;
282283
});
283284
}
284285

0 commit comments

Comments
 (0)