Skip to content

Commit d9db2bc

Browse files
committed
Doing some variable validation..,
1 parent 4bae339 commit d9db2bc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Health/HealthClient.php

+9
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ public function checks($service, QueryOptions $queryOptions = null)
127127
*/
128128
public function service($service, $tag = '', $passingOnly = false, QueryOptions $queryOptions = null)
129129
{
130+
if (!is_string($service))
131+
{
132+
return [null, null, new Error(sprintf(
133+
'%s::service - $service must be string, %s seen.',
134+
get_class($this),
135+
gettype($service)
136+
))];
137+
}
138+
130139
$r = new HttpRequest('get', sprintf('v1/health/service/%s', $service), $this->_Config);
131140
$r->setQueryOptions($queryOptions);
132141
if ('' !== $tag)

0 commit comments

Comments
 (0)