public static function isListOf($value, ?string $type): bool
    {
        if (!static::isTraversable($value)) {
            return false;
        }

        if ($type === null) {
            return true;
        }

        $result = true;

        foreach ($value as $val) {
            if (!static::isType($val, $type)) {
                $result = false;
                break;
            }
        }

        return $result;
    }