Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -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.',
);
}