diff options
Diffstat (limited to 'library/Director/RestApi')
-rw-r--r-- | library/Director/RestApi/RestApiClient.php | 9 | ||||
-rw-r--r-- | library/Director/RestApi/RestApiParams.php | 3 |
2 files changed, 6 insertions, 6 deletions
diff --git a/library/Director/RestApi/RestApiClient.php b/library/Director/RestApi/RestApiClient.php index 2ebc4d4..6dcf93c 100644 --- a/library/Director/RestApi/RestApiClient.php +++ b/library/Director/RestApi/RestApiClient.php @@ -8,7 +8,6 @@ use RuntimeException; class RestApiClient { - /** @var resource */ private $curl; /** @var string HTTP or HTTPS */ @@ -287,7 +286,7 @@ class RestApiClient if ($statusCode >= 400) { throw new RuntimeException( - "Got $statusCode: " . \var_export($res, 1) + "Got $statusCode: " . \var_export($res, true) ); } @@ -295,14 +294,14 @@ class RestApiClient } /** - * @return resource + * @throws RuntimeException */ protected function curl() { if ($this->curl === null) { - $this->curl = \curl_init(\sprintf('https://%s:%d', $this->host, $this->port)); + $this->curl = curl_init(sprintf('https://%s:%d', $this->host, $this->port)); if (! $this->curl) { - throw new RuntimeException('CURL INIT ERROR: ' . \curl_error($this->curl)); + throw new RuntimeException('CURL INIT FAILED'); } } diff --git a/library/Director/RestApi/RestApiParams.php b/library/Director/RestApi/RestApiParams.php index c237ac5..741eeed 100644 --- a/library/Director/RestApi/RestApiParams.php +++ b/library/Director/RestApi/RestApiParams.php @@ -19,8 +19,9 @@ class RestApiParams } $exporter->enableHostServices(); } + /** @var ?string $properties */ $properties = $params->shift('properties'); - if ($properties !== null && strlen($properties)) { + if ($properties) { $exporter->filterProperties(preg_split('/\s*,\s*/', $properties, -1, PREG_SPLIT_NO_EMPTY)); } $exporter->resolveObjects($resolved); |