/home/techb158/dev.balacoffee.com/vendor/sebastian/type/src/type
NameSizeModeActions
CallableType.php51030644editdlrm
FalseType.php8800644editdlrm
GenericObjectType.php10730644editdlrm
IntersectionType.php27890644editdlrm
IterableType.php18930644editdlrm
MixedType.php7940644editdlrm
NeverType.php7140644editdlrm
NullType.php7910644editdlrm
ObjectType.php16200644editdlrm
SimpleType.php20510644editdlrm
StaticType.php14660644editdlrm
TrueType.php8750644editdlrm
Type.php47840644editdlrm
UnionType.php29530644editdlrm
UnknownType.php7790644editdlrm
VoidType.php7100644editdlrm
Edit: /home/techb158/dev.balacoffee.com/vendor/sebastian/type/src/type/IterableType.php (1893B)
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SebastianBergmann\Type; use function assert; use function class_exists; use function is_iterable; use ReflectionClass; use ReflectionException; 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) { $className = $other->className()->qualifiedName(); assert(class_exists($className)); try { return (new ReflectionClass($className))->isIterable(); // @codeCoverageIgnoreStart } catch (ReflectionException $e) { throw new RuntimeException( $e->getMessage(), (int) $e->getCode(), $e ); // @codeCoverageIgnoreEnd } } return false; } public function name(): string { return 'iterable'; } public function allowsNull(): bool { return $this->allowsNull; } /** * @psalm-assert-if-true IterableType $this */ public function isIterable(): bool { return true; } }