Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
CssAtCharsetParserPlugin Class Reference
Inheritance diagram for CssAtCharsetParserPlugin:
aCssParserPlugin

Public Member Functions

 getTriggerChars ()
 getTriggerStates ()
 parse ($index, $char, $previousChar, $state)
- Public Member Functions inherited from aCssParserPlugin
 __construct (CssParser $parser, array $configuration=null)

Additional Inherited Members

- Protected Attributes inherited from aCssParserPlugin
 $configuration = array()
 $parser = null
 $buffer = ""

Detailed Description

Definition at line 5032 of file cssmin.php.

Member Function Documentation

CssAtCharsetParserPlugin::getTriggerChars ( )

Implements aCssParserPlugin::getTriggerChars().

Returns
array

Reimplemented from aCssParserPlugin.

Definition at line 5039 of file cssmin.php.

{
return array("@", ";", "\n");
}
CssAtCharsetParserPlugin::getTriggerStates ( )

Implements aCssParserPlugin::getTriggerStates().

Returns
array

Reimplemented from aCssParserPlugin.

Definition at line 5048 of file cssmin.php.

{
return array("T_DOCUMENT", "T_AT_CHARSET");
}
CssAtCharsetParserPlugin::parse (   $index,
  $char,
  $previousChar,
  $state 
)

Implements aCssParserPlugin::parse().

Parameters
integer$indexCurrent index
string$charCurrent char
string$previousCharPrevious char
Returns
mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing

Reimplemented from aCssParserPlugin.

Definition at line 5060 of file cssmin.php.

{
if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 8)) === "@charset")
{
$this->parser->pushState("T_AT_CHARSET");
$this->parser->clearBuffer();
return $index + 8;
}
elseif (($char === ";" || $char === "\n") && $state === "T_AT_CHARSET")
{
$charset = $this->parser->getAndClearBuffer(";");
$this->parser->popState();
$this->parser->appendToken(new CssAtCharsetToken($charset));
}
else
{
return false;
}
return true;
}

The documentation for this class was generated from the following file: