Skip to content

Commit dfe2d01

Browse files
committed
fix(query-builder-mixin): specify return type for closure functions
- Add `@noinspection PhpUnused` annotation for unused symbols. - Define explicit `mixed` return type for closures in `ddRawSql`, `ddSoarArrayScores`, and `ddSoarJsonScores` methods. - Ensure compatibility with stricter type declarations for improved code stability and clarity.
1 parent 37f3c3f commit dfe2d01

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Mixins/QueryBuilderMixin.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/** @noinspection PhpMethodParametersCountMismatchInspection */
44
/** @noinspection PhpParamsInspection */
5+
/** @noinspection PhpUnused */
56

67
declare(strict_types=1);
78

@@ -51,7 +52,7 @@ public function dumpRawSql(): \Closure
5152
*/
5253
public function ddRawSql(): \Closure
5354
{
54-
return fn () => dd($this->toRawSql());
55+
return fn (): mixed => dd($this->toRawSql());
5556
}
5657

5758
public function toSoarArrayScores(): \Closure
@@ -80,7 +81,7 @@ public function dumpSoarArrayScores(): \Closure
8081
*/
8182
public function ddSoarArrayScores(): \Closure
8283
{
83-
return fn (int $depth = 512, int $options = 0) => dd($this->toSoarArrayScores($depth, $options));
84+
return fn (int $depth = 512, int $options = 0): mixed => dd($this->toSoarArrayScores($depth, $options));
8485
}
8586

8687
public function toSoarJsonScores(): \Closure
@@ -105,7 +106,7 @@ public function dumpSoarJsonScores(): \Closure
105106
*/
106107
public function ddSoarJsonScores(): \Closure
107108
{
108-
return fn () => dd($this->toSoarJsonScores());
109+
return fn (): mixed => dd($this->toSoarJsonScores());
109110
}
110111

111112
public function toSoarHtmlScores(): \Closure

0 commit comments

Comments
 (0)