diff --git a/src/Jobs/BaseJob.php b/src/Jobs/BaseJob.php index 1b4607a..661489d 100644 --- a/src/Jobs/BaseJob.php +++ b/src/Jobs/BaseJob.php @@ -539,22 +539,23 @@ public function __toString() return sprintf('%s %s', get_class($this), $this->description); } - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->data[$offset]); } + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->data[$offset]; } - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $this->data[$offset] = $value; } - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->data[$offset]); } diff --git a/src/Jobs/Collection.php b/src/Jobs/Collection.php index da1a5e2..9739523 100644 --- a/src/Jobs/Collection.php +++ b/src/Jobs/Collection.php @@ -177,7 +177,7 @@ public function fromWorker(string $worker, string $subTimeInterval = ''): array * @param string $jid * @return bool */ - public function offsetExists($jid) + public function offsetExists($jid): bool { return $this->client->get($jid) !== null; } @@ -190,6 +190,7 @@ public function offsetExists($jid) * * @throws QlessException */ + #[\ReturnTypeWillChange] public function offsetGet($jid) { $data = $this->client->get($jid); @@ -215,7 +216,7 @@ public function offsetGet($jid) * * @throws UnsupportedFeatureException */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { throw new UnsupportedFeatureException('Setting a job is not supported using Jobs collection.'); } @@ -225,7 +226,7 @@ public function offsetSet($offset, $value) * * @throws UnsupportedFeatureException */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { throw new UnsupportedFeatureException('Deleting a job is not supported using Jobs collection.'); } diff --git a/src/Jobs/JobData.php b/src/Jobs/JobData.php index c84cbf7..f1bf01a 100644 --- a/src/Jobs/JobData.php +++ b/src/Jobs/JobData.php @@ -17,7 +17,7 @@ final class JobData extends ArrayObject implements JsonSerializable * * @return array */ - public function jsonSerialize() + public function jsonSerialize(): array { return $this->toArray(); } @@ -25,9 +25,9 @@ public function jsonSerialize() /** * Creates a copy of the ArrayObject (alias for \ArrayObject::getArrayCopy). * - * @see \ArrayObject::getArrayCopy - * * @return array + * @see ArrayObject::getArrayCopy + * */ public function toArray(): array { diff --git a/src/Queues/Collection.php b/src/Queues/Collection.php index 5d1b5d9..5894176 100644 --- a/src/Queues/Collection.php +++ b/src/Queues/Collection.php @@ -100,7 +100,7 @@ public function fromSubscriptions(string $topic): array * @param mixed $offset * @return bool */ - public function offsetExists($offset) + public function offsetExists($offset): bool { $queues = json_decode($this->client->queues(), true) ?: []; @@ -119,7 +119,7 @@ public function offsetExists($offset) * @param string $offset * @return Queue */ - public function offsetGet($offset) + public function offsetGet($offset): Queue { return new Queue($offset, $this->client); } @@ -129,7 +129,7 @@ public function offsetGet($offset) * * @throws UnsupportedFeatureException */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { throw new UnsupportedFeatureException('Setting a queue is not supported using Queues collection.'); } @@ -139,7 +139,7 @@ public function offsetSet($offset, $value) * * @throws QlessException If the queue is not empty. */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { $this[$offset]->forget(); } diff --git a/src/Workers/Collection.php b/src/Workers/Collection.php index 8c65ee6..3b9bf8c 100644 --- a/src/Workers/Collection.php +++ b/src/Workers/Collection.php @@ -72,7 +72,7 @@ public function getRange(int $start, int $last): array * @param mixed $offset * @return bool */ - public function offsetExists($offset) + public function offsetExists($offset): bool { $workers = json_decode($this->client->workers(), true) ?: []; @@ -91,7 +91,7 @@ public function offsetExists($offset) * @param string $offset * @return array */ - public function offsetGet($offset) + public function offsetGet($offset): array { $worker = json_decode($this->client->workers($offset), true) ?: []; @@ -107,7 +107,7 @@ public function offsetGet($offset) * * @throws UnsupportedFeatureException */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { throw new UnsupportedFeatureException('Setting a worker is not supported using Workers collection.'); } @@ -117,7 +117,7 @@ public function offsetSet($offset, $value) * * @throws UnsupportedFeatureException */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { throw new UnsupportedFeatureException('Deleting a worker is not supported using Workers collection.'); }