Skip to content

Commit bf65af5

Browse files
committed
patch: allow passing an instance of QueryBuilder into getAssessmentData rather than an array
1 parent 7315c65 commit bf65af5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/SteerConnector.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@ public function __construct(
2121
}
2222

2323
/**
24-
* @param array<string, string|int> $filters
24+
* @param QueryBuilder|array<string, string|int> $filters
2525
* @param int|null $year
2626
* @return Response
2727
* @throws InvalidResponseClassException
2828
* @throws PendingRequestException
29-
* @throws ReflectionException
29+
* @throws ReflectionException|\Throwable
3030
*/
31-
public function getAssessmentData(array $filters, ?int $year = null): Response
31+
public function getAssessmentData(QueryBuilder|array $filters, ?int $year = null): Response
3232
{
33+
if ($filters instanceof QueryBuilder) {
34+
$filters = $filters->filters;
35+
$year = $filters->year;
36+
}
3337
return $this->send(new QueryDataRequest($filters, $year))->throw();
3438
}
3539

0 commit comments

Comments
 (0)