Add findSlots method
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
"psr/http-client": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"guzzlehttp/guzzle": "^7.9"
|
||||
"guzzlehttp/guzzle": "^7.9",
|
||||
"phpstan/phpstan": "^2.1"
|
||||
}
|
||||
}
|
||||
|
6
phpstan.neon
Normal file
6
phpstan.neon
Normal file
@ -0,0 +1,6 @@
|
||||
parameters:
|
||||
level: 5
|
||||
|
||||
# Paths to include in the analysis
|
||||
paths:
|
||||
- src
|
@ -48,4 +48,20 @@ class SlotDbClient
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function findSlots(array $where = [], array $what = [], int $limit = 250, int $page = 0): array
|
||||
{
|
||||
$query = [
|
||||
'limit' => $limit,
|
||||
'page' => $page,
|
||||
'get' => join(",",$what),
|
||||
];
|
||||
foreach ($where as $prop=>$cond) {
|
||||
$whereCond = "{$prop}:{$cond}";
|
||||
$query['where[]'] = $whereCond;
|
||||
}
|
||||
$res = $this->get("/slots", $query);
|
||||
$data = json_decode($res->getBody(), true);
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user