Aggiornato Composer
This commit is contained in:
16
vendor/ramsey/collection/src/Queue.php
vendored
16
vendor/ramsey/collection/src/Queue.php
vendored
@@ -37,17 +37,13 @@ class Queue extends AbstractArray implements QueueInterface
|
||||
*
|
||||
* A queue's type is immutable once it is set. For this reason, this
|
||||
* property is set private.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $queueType;
|
||||
private string $queueType;
|
||||
|
||||
/**
|
||||
* The index of the head of the queue.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $index = 0;
|
||||
protected int $index = 0;
|
||||
|
||||
/**
|
||||
* Constructs a queue object of the specified type, optionally with the
|
||||
@@ -68,13 +64,15 @@ class Queue extends AbstractArray implements QueueInterface
|
||||
* Since arbitrary offsets may not be manipulated in a queue, this method
|
||||
* serves only to fulfill the `ArrayAccess` interface requirements. It is
|
||||
* invoked by other operations when adding values to the queue.
|
||||
*
|
||||
* @throws InvalidArgumentException if $value is of the wrong type
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if ($this->checkType($this->getType(), $value) === false) {
|
||||
throw new InvalidArgumentException(
|
||||
'Value must be of type ' . $this->getType() . '; value is '
|
||||
. $this->toolValueToString($value)
|
||||
. $this->toolValueToString($value),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -82,6 +80,8 @@ class Queue extends AbstractArray implements QueueInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidArgumentException if $value is of the wrong type
|
||||
*
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function add($element): bool
|
||||
@@ -100,7 +100,7 @@ class Queue extends AbstractArray implements QueueInterface
|
||||
|
||||
if ($element === null) {
|
||||
throw new NoSuchElementException(
|
||||
'Can\'t return element from Queue. Queue is empty.'
|
||||
'Can\'t return element from Queue. Queue is empty.',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user