original_string: protected static function prepareAttributes($attributes)
      {
          $prepared = array();
          if (is_string($attributes)) {
              return self::parseAttributes($attributes);
  
          } elseif (is_array($attributes)) {
              foreach ($attributes as $key => $value) {
                  if (is_int($key)) {
                      $key = strtolower($value);
                      $prepared[$key] = $key;
                  } else {
                      $prepared[strtolower($key)] = (string)$value;
                  }
              }
          }
          return $prepared;
      }
code: protected static function prepareAttributes($attributes)
      {
          $prepared = array();
          if (is_string($attributes)) {
              return self::parseAttributes($attributes);
  
          } elseif (is_array($attributes)) {
              foreach ($attributes as $key => $value) {
                  if (is_int($key)) {
                      $key = strtolower($value);
                      $prepared[$key] = $key;
                  } else {
                      $prepared[strtolower($key)] = (string)$value;
                  }
              }
          }
          return $prepared;
      }
code_tokens: protected static function prepareAttributes ( $ attributes ) { $ prepared = array ( ) ; if ( is_string ( $ attributes ) ) { return self :: parseAttributes ( $ attributes ) ; } elseif ( is_array ( $ attributes ) ) { foreach ( $ attributes as $ key => $ value ) { if ( is_int ( $ key ) ) { $ key = strtolower ( $ value ) ; $ prepared [ $ key ] = $ key ; } else { $ prepared [ strtolower ( $ key ) ] = ( string ) $ value ; } } } return $ prepared ; }
docstring: Creates a valid attribute array from either a string or an array
  
  @param    mixed   Array of attributes or HTML attribute string
  @return   array   An associative aray of attributes
docstring_tokens: Creates a valid attribute array from either a string or an array