| @@ 3280-3293 (lines=14) @@ | ||
| 3277 | * @return bool |
|
| 3278 | * <p>Returns true if associative, false otherwise.</p> |
|
| 3279 | */ |
|
| 3280 | public function isAssoc(bool $recursive = false): bool |
|
| 3281 | { |
|
| 3282 | if ($this->isEmpty()) { |
|
| 3283 | return false; |
|
| 3284 | } |
|
| 3285 | ||
| 3286 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3287 | foreach ($this->keys($recursive)->getGeneratorByReference() as &$key) { |
|
| 3288 | if ((string) $key !== $key) { |
|
| 3289 | return false; |
|
| 3290 | } |
|
| 3291 | } |
|
| 3292 | ||
| 3293 | return true; |
|
| 3294 | } |
|
| 3295 | ||
| 3296 | /** |
|
| @@ 3358-3371 (lines=14) @@ | ||
| 3355 | * @return bool |
|
| 3356 | * <p>Returns true if numeric, false otherwise.</p> |
|
| 3357 | */ |
|
| 3358 | public function isNumeric(): bool |
|
| 3359 | { |
|
| 3360 | if ($this->isEmpty()) { |
|
| 3361 | return false; |
|
| 3362 | } |
|
| 3363 | ||
| 3364 | /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */ |
|
| 3365 | foreach ($this->keys()->getGeneratorByReference() as &$key) { |
|
| 3366 | if ((int) $key !== $key) { |
|
| 3367 | return false; |
|
| 3368 | } |
|
| 3369 | } |
|
| 3370 | ||
| 3371 | return true; |
|
| 3372 | } |
|
| 3373 | ||
| 3374 | /** |
|