← All changes
|
includes/sdk/google/ramsey/collection/src/DoubleEndedQueueInterface.php
+18
-22
1.2.7
→
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 linear collection that supports element insertion and removal at both ends. |
| 19 | 19 | * |
| @@ -177,10 +177,9 @@ | ||
| 177 | 177 | * for any reason other than that it already contains the element. |
| 178 | 178 | * Implementations should use a more-specific exception that extends |
| 179 | 179 | * `\RuntimeException`. |
| 180 | 180 | */ |
| 181 | - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint | |
| 182 | - public function addFirst($element): bool; | |
| 181 | + public function addFirst(mixed $element) : bool; | |
| 183 | 182 | /** |
| 184 | 183 | * Inserts the specified element at the end of this queue if it is possible |
| 185 | 184 | * to do so immediately without violating capacity restrictions. |
| 186 | 185 | * |
| @@ -197,10 +196,9 @@ | ||
| 197 | 196 | * for any reason other than that it already contains the element. |
| 198 | 197 | * Implementations should use a more-specific exception that extends |
| 199 | 198 | * `\RuntimeException`. |
| 200 | 199 | */ |
| 201 | - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint | |
| 202 | - public function addLast($element): bool; | |
| 200 | + public function addLast(mixed $element) : bool; | |
| 203 | 201 | /** |
| 204 | 202 | * Inserts the specified element at the front of this queue if it is |
| 205 | 203 | * possible to do so immediately without violating capacity restrictions. |
| 206 | 204 | * |
| @@ -211,10 +209,9 @@ | ||
| 211 | 209 | * @param T $element The element to add to the front of this queue. |
| 212 | 210 | * |
| 213 | 211 | * @return bool `true` if the element was added to this queue, else `false`. |
| 214 | 212 | */ |
| 215 | - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint | |
| 216 | - public function offerFirst($element): bool; | |
| 213 | + public function offerFirst(mixed $element) : bool; | |
| 217 | 214 | /** |
| 218 | 215 | * Inserts the specified element at the end of this queue if it is possible |
| 219 | 216 | * to do so immediately without violating capacity restrictions. |
| 220 | 217 | * |
| @@ -225,10 +222,9 @@ | ||
| 225 | 222 | * @param T $element The element to add to the end of this queue. |
| 226 | 223 | * |
| 227 | 224 | * @return bool `true` if the element was added to this queue, else `false`. |
| 228 | 225 | */ |
| 229 | - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint | |
| 230 | - public function offerLast($element): bool; | |
| 226 | + public function offerLast(mixed $element) : bool; | |
| 231 | 227 | /** |
| 232 | 228 | * Retrieves and removes the head of this queue. |
| 233 | 229 | * |
| 234 | 230 | * This method differs from `pollFirst()` only in that it throws an |
| @@ -237,9 +233,9 @@ | ||
| 237 | 233 | * @return T the first element in this queue. |
| 238 | 234 | * |
| 239 | 235 | * @throws NoSuchElementException if this queue is empty. |
| 240 | 236 | */ |
| 241 | - public function removeFirst(); | |
| 237 | + public function removeFirst() : mixed; | |
| 242 | 238 | /** |
| 243 | 239 | * Retrieves and removes the tail of this queue. |
| 244 | 240 | * |
| 245 | 241 | * This method differs from `pollLast()` only in that it throws an exception |
| @@ -248,23 +244,23 @@ | ||
| 248 | 244 | * @return T the last element in this queue. |
| 249 | 245 | * |
| 250 | 246 | * @throws NoSuchElementException if this queue is empty. |
| 251 | 247 | */ |
| 252 | - public function removeLast(); | |
| 248 | + public function removeLast() : mixed; | |
| 253 | 249 | /** |
| 254 | 250 | * Retrieves and removes the head of this queue, or returns `null` if this |
| 255 | 251 | * queue is empty. |
| 256 | 252 | * |
| 257 | - * @return T|null the head of this queue, or `null` if this queue is empty. | |
| 253 | + * @return T | null the head of this queue, or `null` if this queue is empty. | |
| 258 | 254 | */ |
| 259 | - public function pollFirst(); | |
| 255 | + public function pollFirst() : mixed; | |
| 260 | 256 | /** |
| 261 | 257 | * Retrieves and removes the tail of this queue, or returns `null` if this |
| 262 | 258 | * queue is empty. |
| 263 | 259 | * |
| 264 | - * @return T|null the tail of this queue, or `null` if this queue is empty. | |
| 260 | + * @return T | null the tail of this queue, or `null` if this queue is empty. | |
| 265 | 261 | */ |
| 266 | - public function pollLast(); | |
| 262 | + public function pollLast() : mixed; | |
| 267 | 263 | /** |
| 268 | 264 | * Retrieves, but does not remove, the head of this queue. |
| 269 | 265 | * |
| 270 | 266 | * This method differs from `peekFirst()` only in that it throws an |
| @@ -273,9 +269,9 @@ | ||
| 273 | 269 | * @return T the head of this queue. |
| 274 | 270 | * |
| 275 | 271 | * @throws NoSuchElementException if this queue is empty. |
| 276 | 272 | */ |
| 277 | - public function firstElement(); | |
| 273 | + public function firstElement() : mixed; | |
| 278 | 274 | /** |
| 279 | 275 | * Retrieves, but does not remove, the tail of this queue. |
| 280 | 276 | * |
| 281 | 277 | * This method differs from `peekLast()` only in that it throws an exception |
| @@ -284,20 +280,20 @@ | ||
| 284 | 280 | * @return T the tail of this queue. |
| 285 | 281 | * |
| 286 | 282 | * @throws NoSuchElementException if this queue is empty. |
| 287 | 283 | */ |
| 288 | - public function lastElement(); | |
| 284 | + public function lastElement() : mixed; | |
| 289 | 285 | /** |
| 290 | 286 | * Retrieves, but does not remove, the head of this queue, or returns `null` |
| 291 | 287 | * if this queue is empty. |
| 292 | 288 | * |
| 293 | - * @return T|null the head of this queue, or `null` if this queue is empty. | |
| 289 | + * @return T | null the head of this queue, or `null` if this queue is empty. | |
| 294 | 290 | */ |
| 295 | - public function peekFirst(); | |
| 291 | + public function peekFirst() : mixed; | |
| 296 | 292 | /** |
| 297 | 293 | * Retrieves, but does not remove, the tail of this queue, or returns `null` |
| 298 | 294 | * if this queue is empty. |
| 299 | 295 | * |
| 300 | - * @return T|null the tail of this queue, or `null` if this queue is empty. | |
| 296 | + * @return T | null the tail of this queue, or `null` if this queue is empty. | |
| 301 | 297 | */ |
| 302 | - public function peekLast(); | |
| 298 | + public function peekLast() : mixed; | |
| 303 | 299 | } |