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;
    }
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;
    }
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 ; }
Checks if value is a list of a given type

The type can be any fully-qualified class or interface name,
or one of the following type strings:
[array, object, bool, int, float, string]

@param mixed       $value The value
@param string|null $type  The type or null to accept all types

@return bool
Checks if value is a list of a given type