CSTokenImageContext
extends CSTokenFileContext
in package
This class represents a concrete token context
Tags
Table of Contents
- __toString() : string
- Generates the string representation of the token context.
- check() : bool
- Checks if the token context instance is valid for the current context.
- createForFileContext() : CSTokenFileContext
- Initializes the context with the matching file name.
- createForImageContext() : CSTokenImageContext
- Initializes the context with a class name.
- createFromDefinition() : CSTokenContext
- Restores a token context from the definition stored in the string representation.
- setClass() : void
- Sets the class name for this context.
- setFile() : void
- Sets the file for this context.
Methods
__toString()
Generates the string representation of the token context.
public
final __toString() : string
Tags
Return values
string —String representation of the token context.
check()
Checks if the token context instance is valid for the current context.
public
final check() : bool
Tags
Return values
bool —True, if token context matches the context, otherwise false.
createForFileContext()
Initializes the context with the matching file name.
public
static createForFileContext(string $sFile) : CSTokenFileContext
Parameters
- $sFile : string
-
The file name valid for this context.
Tags
Return values
CSTokenFileContext —The token context instance.
createForImageContext()
Initializes the context with a class name.
public
static createForImageContext(string $sClass) : CSTokenImageContext
Parameters
- $sClass : string
-
The class name valid for the token context.
Tags
Return values
CSTokenImageContext —The concrete token context.
createFromDefinition()
Restores a token context from the definition stored in the string representation.
public
final static createFromDefinition(array<string|int, mixed> $aDefinition) : CSTokenContext
Parameters
- $aDefinition : array<string|int, mixed>
-
The token context definition retrieved from string representation.
Tags
Return values
CSTokenContext —A concrete instance of CSToken Context.
setClass()
Sets the class name for this context.
public
setClass(string $sClass) : void
Parameters
- $sClass : string
-
The class name for this context.
Tags
Return values
void —setFile()
Sets the file for this context.
public
setFile(string $sFile) : void
Parameters
- $sFile : string
-
The file name matching the context.
