You are here

final class CssToken in QueryPath 6

Same name and namespace in other branches
  1. 7.3 QueryPath/CssParser.php \CssToken
  2. 7.2 QueryPath/CssParser.php \CssToken

Hierarchy

Expanded class hierarchy of CssToken

File

QueryPath/CssParser.php, line 60

View source
final class CssToken {
  const char = 0;
  const star = 1;
  const rangle = 2;
  const dot = 3;
  const octo = 4;
  const rsquare = 5;
  const lsquare = 6;
  const colon = 7;
  const rparen = 8;
  const lparen = 9;
  const plus = 10;
  const tilde = 11;
  const eq = 12;
  const pipe = 13;
  const comma = 14;
  const white = 15;
  const quote = 16;
  const squote = 17;
  const bslash = 18;
  const carat = 19;
  const dollar = 20;
  const at = 21;
  const stringLegal = 99;
  static function name($const_int) {
    $a = array(
      'character',
      'star',
      'right angle bracket',
      'dot',
      'octothorp',
      'right square bracket',
      'left square bracket',
      'colon',
      'right parenthesis',
      'left parenthesis',
      'plus',
      'tilde',
      'equals',
      'vertical bar',
      'comma',
      'space',
      'quote',
      'single quote',
      'backslash',
      'carat',
      'dollar',
      'at',
    );
    if (isset($a[$const_int]) && is_numeric($const_int)) {
      return $a[$const_int];
    }
    elseif ($const_int == 99) {
      return 'a legal non-alphanumeric character';
    }
    elseif ($const_int == FALSE) {
      return 'end of file';
    }
    return sprintf('illegal character (%s)', $const_int);
  }

}

Members