From 03cb7a30023a28a9e108db5fd51ab43869561fe2 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Sun, 28 Jan 2024 16:35:33 +0100 Subject: [PATCH] Fix phpDocs --- src/DataStructures/StrictList.php | 2 +- src/InterfaceTraits/ArrayAccessTrait.php | 10 ++++++++++ src/InterfaceTraits/CountableTrait.php | 4 ++++ src/InterfaceTraits/IteratorAggregateTrait.php | 4 ++++ src/InterfaceTraits/IteratorTrait.php | 14 ++++++++++++++ 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/DataStructures/StrictList.php b/src/DataStructures/StrictList.php index c3d19f0..3244072 100644 --- a/src/DataStructures/StrictList.php +++ b/src/DataStructures/StrictList.php @@ -205,7 +205,7 @@ class StrictList extends SplDoublyLinkedList implements ArrayAccess, Countable, * * @throws InvalidArgumentException * - * @internal + * @api */ public function offsetSet(mixed $offset, mixed $value): void { diff --git a/src/InterfaceTraits/ArrayAccessTrait.php b/src/InterfaceTraits/ArrayAccessTrait.php index ee4434b..69b540a 100644 --- a/src/InterfaceTraits/ArrayAccessTrait.php +++ b/src/InterfaceTraits/ArrayAccessTrait.php @@ -31,6 +31,8 @@ use ArrayAccess; * @author Sebastian Meyer * @package Basics\InterfaceTraits * + * @api + * * @template TKey of int|string * @template TValue of mixed * @template TData of array @@ -52,6 +54,8 @@ trait ArrayAccessTrait * @param TKey $offset The offset to check for * * @return bool Whether the offset exists + * + * @api */ public function offsetExists(mixed $offset): bool { @@ -64,6 +68,8 @@ trait ArrayAccessTrait * @param TKey $offset The offset to retrieve at * * @return ?TValue The value at the offset or NULL + * + * @api */ public function offsetGet(mixed $offset): mixed { @@ -77,6 +83,8 @@ trait ArrayAccessTrait * @param TValue $value The value to set * * @return void + * + * @api */ public function offsetSet(mixed $offset, mixed $value): void { @@ -93,6 +101,8 @@ trait ArrayAccessTrait * @param TKey $offset The offset to unset * * @return void + * + * @api */ public function offsetUnset(mixed $offset): void { diff --git a/src/InterfaceTraits/CountableTrait.php b/src/InterfaceTraits/CountableTrait.php index b879aba..69f10f8 100644 --- a/src/InterfaceTraits/CountableTrait.php +++ b/src/InterfaceTraits/CountableTrait.php @@ -31,6 +31,8 @@ use Countable; * @author Sebastian Meyer * @package Basics\InterfaceTraits * + * @api + * * @template TKey of int|string * @template TValue of mixed * @template TData of array @@ -50,6 +52,8 @@ trait CountableTrait * Count the data items. * * @return int The number of data items + * + * @api */ public function count(): int { diff --git a/src/InterfaceTraits/IteratorAggregateTrait.php b/src/InterfaceTraits/IteratorAggregateTrait.php index dc97252..83fc8d4 100644 --- a/src/InterfaceTraits/IteratorAggregateTrait.php +++ b/src/InterfaceTraits/IteratorAggregateTrait.php @@ -32,6 +32,8 @@ use IteratorAggregate; * @author Sebastian Meyer * @package Basics\InterfaceTraits * + * @api + * * @template TKey of int|string * @template TValue of mixed * @template TData of array @@ -51,6 +53,8 @@ trait IteratorAggregateTrait * Retrieve an external iterator. * * @return ArrayIterator New array iterator for data array + * + * @api */ public function getIterator(): ArrayIterator { diff --git a/src/InterfaceTraits/IteratorTrait.php b/src/InterfaceTraits/IteratorTrait.php index 52bbd9e..c84a2f0 100644 --- a/src/InterfaceTraits/IteratorTrait.php +++ b/src/InterfaceTraits/IteratorTrait.php @@ -31,6 +31,8 @@ use Iterator; * @author Sebastian Meyer * @package Basics\InterfaceTraits * + * @api + * * @template TKey of int|string * @template TValue of mixed * @template TData of array @@ -50,6 +52,8 @@ trait IteratorTrait * Return the current item. * * @return TValue|false The current item or FALSE if invalid + * + * @api */ public function current(): mixed { @@ -60,6 +64,8 @@ trait IteratorTrait * Return the current key. * * @return ?TKey The current key or NULL if invalid + * + * @api */ public function key(): mixed { @@ -70,6 +76,8 @@ trait IteratorTrait * Move forward to next item. * * @return void + * + * @api */ public function next(): void { @@ -80,6 +88,8 @@ trait IteratorTrait * Move back to previous item. * * @return void + * + * @api */ public function prev(): void { @@ -90,6 +100,8 @@ trait IteratorTrait * Rewind the iterator to the first item. * * @return void + * + * @api */ public function rewind(): void { @@ -100,6 +112,8 @@ trait IteratorTrait * Check if current position is valid. * * @return bool Whether the current position is valid + * + * @api */ public function valid(): bool {