Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Jobs/BaseJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
7 changes: 4 additions & 3 deletions src/Jobs/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -190,6 +190,7 @@ public function offsetExists($jid)
*
* @throws QlessException
*/
#[\ReturnTypeWillChange]
public function offsetGet($jid)
{
$data = $this->client->get($jid);
Expand All @@ -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.');
}
Expand All @@ -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.');
}
Expand Down
6 changes: 3 additions & 3 deletions src/Jobs/JobData.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ final class JobData extends ArrayObject implements JsonSerializable
*
* @return array
*/
public function jsonSerialize()
public function jsonSerialize(): array
{
return $this->toArray();
}

/**
* Creates a copy of the ArrayObject (alias for \ArrayObject::getArrayCopy).
*
* @see \ArrayObject::getArrayCopy
*
* @return array
* @see ArrayObject::getArrayCopy
*
*/
public function toArray(): array
{
Expand Down
8 changes: 4 additions & 4 deletions src/Queues/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) ?: [];

Expand All @@ -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);
}
Expand All @@ -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.');
}
Expand All @@ -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();
}
Expand Down
8 changes: 4 additions & 4 deletions src/Workers/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) ?: [];

Expand All @@ -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) ?: [];

Expand All @@ -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.');
}
Expand All @@ -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.');
}
Expand Down