← All changes
|
includes/sdk/google/ramsey/collection/src/QueueInterface.php
+11
-13
1.2.11
→
1.4.1
View file →
| @@ -9,11 +9,11 @@ | ||
| 9 | 9 | * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com> |
| 10 | 10 | * @license http://opensource.org/licenses/MIT MIT |
| 11 | 11 | */ |
| 12 | 12 | declare (strict_types=1); |
| 13 | -namespace Dudlewebs\WPMCS\Ramsey\Collection; | |
| 13 | +namespace Dudlewebs\WPMCS\GCP\Ramsey\Collection; | |
| 14 | 14 | |
| 15 | -use Dudlewebs\WPMCS\Ramsey\Collection\Exception\NoSuchElementException; | |
| 15 | +use Dudlewebs\WPMCS\GCP\Ramsey\Collection\Exception\NoSuchElementException; | |
| 16 | 16 | use RuntimeException; |
| 17 | 17 | /** |
| 18 | 18 | * A queue is a collection in which the entities in the collection are kept in |
| 19 | 19 | * order. |
| @@ -125,10 +125,9 @@ | ||
| 125 | 125 | * for any reason other than that it already contains the element. |
| 126 | 126 | * Implementations should use a more-specific exception that extends |
| 127 | 127 | * `\RuntimeException`. |
| 128 | 128 | */ |
| 129 | - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint | |
| 130 | - public function add($element): bool; | |
| 129 | + public function add(mixed $element) : bool; | |
| 131 | 130 | /** |
| 132 | 131 | * Retrieves, but does not remove, the head of this queue. |
| 133 | 132 | * |
| 134 | 133 | * This method differs from `peek()` only in that it throws an exception if |
| @@ -139,9 +138,9 @@ | ||
| 139 | 138 | * @return T the head of this queue. |
| 140 | 139 | * |
| 141 | 140 | * @throws NoSuchElementException if this queue is empty. |
| 142 | 141 | */ |
| 143 | - public function element(); | |
| 142 | + public function element() : mixed; | |
| 144 | 143 | /** |
| 145 | 144 | * Inserts the specified element into this queue if it is possible to do so |
| 146 | 145 | * immediately without violating capacity restrictions. |
| 147 | 146 | * |
| @@ -154,10 +153,9 @@ | ||
| 154 | 153 | * @param T $element The element to add to this queue. |
| 155 | 154 | * |
| 156 | 155 | * @return bool `true` if the element was added to this queue, else `false`. |
| 157 | 156 | */ |
| 158 | - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint | |
| 159 | - public function offer($element): bool; | |
| 157 | + public function offer(mixed $element) : bool; | |
| 160 | 158 | /** |
| 161 | 159 | * Retrieves, but does not remove, the head of this queue, or returns `null` |
| 162 | 160 | * if this queue is empty. |
| 163 | 161 | * |
| @@ -162,11 +160,11 @@ | ||
| 162 | 160 | * if this queue is empty. |
| 163 | 161 | * |
| 164 | 162 | * @see self::element() |
| 165 | 163 | * |
| 166 | - * @return T|null the head of this queue, or `null` if this queue is empty. | |
| 164 | + * @return T | null the head of this queue, or `null` if this queue is empty. | |
| 167 | 165 | */ |
| 168 | - public function peek(); | |
| 166 | + public function peek() : mixed; | |
| 169 | 167 | /** |
| 170 | 168 | * Retrieves and removes the head of this queue, or returns `null` |
| 171 | 169 | * if this queue is empty. |
| 172 | 170 | * |
| @@ -171,11 +169,11 @@ | ||
| 171 | 169 | * if this queue is empty. |
| 172 | 170 | * |
| 173 | 171 | * @see self::remove() |
| 174 | 172 | * |
| 175 | - * @return T|null the head of this queue, or `null` if this queue is empty. | |
| 173 | + * @return T | null the head of this queue, or `null` if this queue is empty. | |
| 176 | 174 | */ |
| 177 | - public function poll(); | |
| 175 | + public function poll() : mixed; | |
| 178 | 176 | /** |
| 179 | 177 | * Retrieves and removes the head of this queue. |
| 180 | 178 | * |
| 181 | 179 | * This method differs from `poll()` only in that it throws an exception if |
| @@ -186,10 +184,10 @@ | ||
| 186 | 184 | * @return T the head of this queue. |
| 187 | 185 | * |
| 188 | 186 | * @throws NoSuchElementException if this queue is empty. |
| 189 | 187 | */ |
| 190 | - public function remove(); | |
| 188 | + public function remove() : mixed; | |
| 191 | 189 | /** |
| 192 | 190 | * Returns the type associated with this queue. |
| 193 | 191 | */ |
| 194 | - public function getType(): string; | |
| 192 | + public function getType() : string; | |
| 195 | 193 | } |