One Hat Cyber Team
Your IP :
18.118.207.114
Server IP :
104.21.96.1
Server :
Linux agrigation-prod 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64
Server Software :
nginx/1.24.0
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
forge
/
gftag.com
/
vendor
/
sebastian
/
type
/
src
/
View File Name :
IterableType.php
<?php declare(strict_types=1); /* * This file is part of sebastian/type. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SebastianBergmann\Type; final class IterableType extends Type { /** * @var bool */ private $allowsNull; public function __construct(bool $nullable) { $this->allowsNull = $nullable; } /** * @throws RuntimeException */ public function isAssignable(Type $other): bool { if ($this->allowsNull && $other instanceof NullType) { return true; } if ($other instanceof self) { return true; } if ($other instanceof SimpleType) { return \is_iterable($other->value()); } if ($other instanceof ObjectType) { try { return (new \ReflectionClass($other->className()->getQualifiedName()))->isIterable(); // @codeCoverageIgnoreStart } catch (\ReflectionException $e) { throw new RuntimeException( $e->getMessage(), (int) $e->getCode(), $e ); // @codeCoverageIgnoreEnd } } return false; } public function getReturnTypeDeclaration(): string { return ': ' . ($this->allowsNull ? '?' : '') . 'iterable'; } public function allowsNull(): bool { return $this->allowsNull; } }