diff --git a/src/PrintNode/Credentials.php b/src/PrintNode/Credentials.php index 571375a..1f11a8a 100755 --- a/src/PrintNode/Credentials.php +++ b/src/PrintNode/Credentials.php @@ -35,7 +35,7 @@ public function setEmailPassword($email, $password) "ApiKey already set." ); } - $this->emailpassword = $email.': '.$password; + $this->emailPassword = $email.': '.$password; return $this; } diff --git a/src/PrintNode/PrintJob.php b/src/PrintNode/PrintJob.php index 610713c..70932ae 100755 --- a/src/PrintNode/PrintJob.php +++ b/src/PrintNode/PrintJob.php @@ -13,6 +13,7 @@ * @property string $contentType * @property string $content * @property string $source + * @property array $options * @property-read int $filesize * @property-read DateTime $createTimestamp * @property-read string $state @@ -29,6 +30,7 @@ class PrintJob extends Entity protected $createTimestamp; protected $state; protected $expireAt; + protected $options; public function foreignKeyEntityMap() { diff --git a/src/PrintNode/Request.php b/src/PrintNode/Request.php index 5727991..290fb93 100755 --- a/src/PrintNode/Request.php +++ b/src/PrintNode/Request.php @@ -112,7 +112,7 @@ public function __construct(Credentials $credentials, array $endPointUrls = arra */ private function makeEndPointUrls() { - $endPointUrls; + $endPointUrls = array(); foreach ($this->methodNameEntityMap as $classes) { $endPointUrls[$classes] = $this->apiurl.$this->endPointUrls[$classes]; } @@ -232,6 +232,8 @@ private function curlGet($endPointUrl) $curlHandle = $this->curlInit(); curl_setopt($curlHandle, CURLOPT_HTTPHEADER, $this->childauth); + $endPointUrl = $this->applyOffsetLimit($endPointUrl); + return $this->curlExec( $curlHandle, $endPointUrl @@ -489,7 +491,7 @@ public function getPrintJobsByPrinters() * @param string $computerId id of computer to find scales * @return Entity[] * */ - public function getScales(string $computerId) + public function getScales($computerId) { $endPointUrl = $this->apiurl."/computer/"; $endPointUrl.= $computerId; @@ -522,7 +524,7 @@ public function getPrintersByComputers() $arguments = func_get_args(); if (count($arguments) > 2) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( 'Too many arguments given to getPrintersByComputers.' ) @@ -570,7 +572,7 @@ public function __call($methodName, $arguments) $arguments = array_shift($arguments); if (!is_string($arguments)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( 'Invalid argument type passed to %s. Expecting a string got %s', $methodName, @@ -614,7 +616,7 @@ public function __call($methodName, $arguments) public function patch(Entity $entity) { if (!($entity instanceof Entity)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( 'Invalid argument type passed to patch. Expecting Entity got %s', gettype($entity) @@ -644,7 +646,7 @@ public function patch(Entity $entity) public function post(Entity $entity) { if (!($entity instanceof Entity)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( 'Invalid argument type passed to patch. Expecting Entity got %s', gettype($entity) @@ -677,7 +679,7 @@ public function put() $entity = array_shift($arguments); if (!($entity instanceof Entity)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( sprintf( 'Invalid argument type passed to patch. Expecting Entity got %s', gettype($entity) diff --git a/src/PrintNode/Scale.php b/src/PrintNode/Scale.php index 3b60eb3..4f6af81 100755 --- a/src/PrintNode/Scale.php +++ b/src/PrintNode/Scale.php @@ -13,7 +13,7 @@ * @property-read string $port * @property-read int $count * @property-read int[string] $measurement - * @property-read DateTime $clientReportedCreateTimestamp + * @property-read \DateTime $clientReportedCreateTimestamp * @property-read string $ntpOffset * @property-read int $ageOfData * @property-read int $computerId @@ -29,7 +29,7 @@ class Scale extends Entity protected $port; protected $count; protected $measurement; - protected $clientReprotedCreateTimestamp; + protected $clientReportedCreateTimestamp; protected $ntpOffset; protected $ageOfData; protected $computerId;