original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Checks if value is a list of a given type