Rename template TValue
This commit is contained in:
parent
983bfc7789
commit
69982816bf
|
@ -32,8 +32,8 @@ use OCC\Basics\Traits\Getter;
|
||||||
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
|
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
|
||||||
* @package opencultureconsulting/basics
|
* @package opencultureconsulting/basics
|
||||||
*
|
*
|
||||||
* @template AllowedTypes
|
* @template AllowedType
|
||||||
* @extends SplDoublyLinkedList<AllowedTypes>
|
* @extends SplDoublyLinkedList<AllowedType>
|
||||||
*/
|
*/
|
||||||
class StrictList extends SplDoublyLinkedList
|
class StrictList extends SplDoublyLinkedList
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,7 @@ class StrictList extends SplDoublyLinkedList
|
||||||
* @see SplDoublyLinkedList::add()
|
* @see SplDoublyLinkedList::add()
|
||||||
*
|
*
|
||||||
* @param int $index The index where the new item is to be inserted
|
* @param int $index The index where the new item is to be inserted
|
||||||
* @param AllowedTypes $item The new item for the index
|
* @param AllowedType $item The new item for the index
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
@ -91,7 +91,7 @@ class StrictList extends SplDoublyLinkedList
|
||||||
/**
|
/**
|
||||||
* Append items at the end of the list.
|
* Append items at the end of the list.
|
||||||
*
|
*
|
||||||
* @param AllowedTypes ...$items One or more items to append
|
* @param AllowedType ...$items One or more items to append
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
@ -118,7 +118,7 @@ class StrictList extends SplDoublyLinkedList
|
||||||
/**
|
/**
|
||||||
* Check if item is an allowed type.
|
* Check if item is an allowed type.
|
||||||
*
|
*
|
||||||
* @param AllowedTypes $item The item to check
|
* @param AllowedType $item The item to check
|
||||||
*
|
*
|
||||||
* @return bool Whether the item is an allowed type
|
* @return bool Whether the item is an allowed type
|
||||||
*/
|
*/
|
||||||
|
@ -156,7 +156,7 @@ class StrictList extends SplDoublyLinkedList
|
||||||
* @see \ArrayAccess::offsetSet()
|
* @see \ArrayAccess::offsetSet()
|
||||||
*
|
*
|
||||||
* @param ?int $index The index being set or NULL to append
|
* @param ?int $index The index being set or NULL to append
|
||||||
* @param AllowedTypes $item The new item for the index
|
* @param AllowedType $item The new item for the index
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
@ -178,7 +178,7 @@ class StrictList extends SplDoublyLinkedList
|
||||||
/**
|
/**
|
||||||
* Prepend items at the start of the list.
|
* Prepend items at the start of the list.
|
||||||
*
|
*
|
||||||
* @param AllowedTypes ...$items One or more items to prepend
|
* @param AllowedType ...$items One or more items to prepend
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
@ -206,7 +206,7 @@ class StrictList extends SplDoublyLinkedList
|
||||||
* Push an item at the end of the list.
|
* Push an item at the end of the list.
|
||||||
* @see SplDoublyLinkedList::push()
|
* @see SplDoublyLinkedList::push()
|
||||||
*
|
*
|
||||||
* @param AllowedTypes $item The item to push
|
* @param AllowedType $item The item to push
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
@ -255,7 +255,7 @@ class StrictList extends SplDoublyLinkedList
|
||||||
* Prepend the list with an item.
|
* Prepend the list with an item.
|
||||||
* @see SplDoublyLinkedList::unshift()
|
* @see SplDoublyLinkedList::unshift()
|
||||||
*
|
*
|
||||||
* @param AllowedTypes $item The item to unshift
|
* @param AllowedType $item The item to unshift
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
@ -277,7 +277,7 @@ class StrictList extends SplDoublyLinkedList
|
||||||
/**
|
/**
|
||||||
* Create a type-sensitive, traversable list of items.
|
* Create a type-sensitive, traversable list of items.
|
||||||
*
|
*
|
||||||
* @param iterable<AllowedTypes> $items Initial set of items
|
* @param iterable<AllowedType> $items Initial set of items
|
||||||
* @param string[] $allowedTypes Allowed types of items (optional)
|
* @param string[] $allowedTypes Allowed types of items (optional)
|
||||||
*
|
*
|
||||||
* @throws InvalidArgumentException
|
* @throws InvalidArgumentException
|
||||||
|
@ -328,7 +328,7 @@ class StrictList extends SplDoublyLinkedList
|
||||||
{
|
{
|
||||||
/** @var string[] $allowedTypes */
|
/** @var string[] $allowedTypes */
|
||||||
$allowedTypes = $data['StrictList::allowedTypes'];
|
$allowedTypes = $data['StrictList::allowedTypes'];
|
||||||
/** @var iterable<AllowedTypes> $items */
|
/** @var iterable<AllowedType> $items */
|
||||||
$items = $data['SplDoublyLinkedList::dllist'];
|
$items = $data['SplDoublyLinkedList::dllist'];
|
||||||
$this->__construct($items, $allowedTypes);
|
$this->__construct($items, $allowedTypes);
|
||||||
/** @var int $flags */
|
/** @var int $flags */
|
||||||
|
|
|
@ -30,8 +30,8 @@ use RuntimeException;
|
||||||
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
|
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
|
||||||
* @package opencultureconsulting/basics
|
* @package opencultureconsulting/basics
|
||||||
*
|
*
|
||||||
* @template AllowedTypes
|
* @template AllowedType
|
||||||
* @extends StrictList<AllowedTypes>
|
* @extends StrictList<AllowedType>
|
||||||
*/
|
*/
|
||||||
class StrictQueue extends StrictList
|
class StrictQueue extends StrictList
|
||||||
{
|
{
|
||||||
|
@ -39,7 +39,7 @@ class StrictQueue extends StrictList
|
||||||
* Dequeue an item from the queue.
|
* Dequeue an item from the queue.
|
||||||
* @see \SplQueue::dequeue()
|
* @see \SplQueue::dequeue()
|
||||||
*
|
*
|
||||||
* @return AllowedTypes The dequeued item
|
* @return AllowedType The dequeued item
|
||||||
*/
|
*/
|
||||||
public function dequeue(): mixed
|
public function dequeue(): mixed
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ class StrictQueue extends StrictList
|
||||||
* Add an item to the queue.
|
* Add an item to the queue.
|
||||||
* @see \SplQueue::enqueue()
|
* @see \SplQueue::enqueue()
|
||||||
*
|
*
|
||||||
* @param AllowedTypes $item The item to enqueue
|
* @param AllowedType $item The item to enqueue
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
@ -87,7 +87,7 @@ class StrictQueue extends StrictList
|
||||||
/**
|
/**
|
||||||
* Create a type-sensitive, traversable queue of items.
|
* Create a type-sensitive, traversable queue of items.
|
||||||
*
|
*
|
||||||
* @param iterable<AllowedTypes> $items Initial set of items
|
* @param iterable<AllowedType> $items Initial set of items
|
||||||
* @param string[] $allowedTypes Allowed types of items (optional)
|
* @param string[] $allowedTypes Allowed types of items (optional)
|
||||||
*/
|
*/
|
||||||
public function __construct(iterable $items = [], array $allowedTypes = [])
|
public function __construct(iterable $items = [], array $allowedTypes = [])
|
||||||
|
|
|
@ -30,15 +30,15 @@ use RuntimeException;
|
||||||
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
|
* @author Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
|
||||||
* @package opencultureconsulting/basics
|
* @package opencultureconsulting/basics
|
||||||
*
|
*
|
||||||
* @template AllowedTypes
|
* @template AllowedType
|
||||||
* @extends StrictList<AllowedTypes>
|
* @extends StrictList<AllowedType>
|
||||||
*/
|
*/
|
||||||
class StrictStack extends StrictList
|
class StrictStack extends StrictList
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Add an item to the stack.
|
* Add an item to the stack.
|
||||||
*
|
*
|
||||||
* @param AllowedTypes $item The item to stack
|
* @param AllowedType $item The item to stack
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
@ -52,7 +52,7 @@ class StrictStack extends StrictList
|
||||||
/**
|
/**
|
||||||
* Unstack an item from the stack.
|
* Unstack an item from the stack.
|
||||||
*
|
*
|
||||||
* @return AllowedTypes The unstacked item
|
* @return AllowedType The unstacked item
|
||||||
*/
|
*/
|
||||||
public function unstack(): mixed
|
public function unstack(): mixed
|
||||||
{
|
{
|
||||||
|
@ -85,7 +85,7 @@ class StrictStack extends StrictList
|
||||||
/**
|
/**
|
||||||
* Create a type-sensitive, traversable stack of items.
|
* Create a type-sensitive, traversable stack of items.
|
||||||
*
|
*
|
||||||
* @param iterable<AllowedTypes> $items Initial set of items
|
* @param iterable<AllowedType> $items Initial set of items
|
||||||
* @param string[] $allowedTypes Allowed types of items (optional)
|
* @param string[] $allowedTypes Allowed types of items (optional)
|
||||||
*/
|
*/
|
||||||
public function __construct(iterable $items = [], array $allowedTypes = [])
|
public function __construct(iterable $items = [], array $allowedTypes = [])
|
||||||
|
|
Loading…
Reference in New Issue