Method |
Description |
|
__construct ( string $identifier, array $config = [] ) |
Create a snippet |
|
addLocal ( string $name, mixed $value ) : void |
Add a local variable to make available in the snippet execution scope. |
|
addUse ( string $name ) : void |
Add a use statement for a class. |
|
content ( ) : string |
The snippet content. |
|
file ( ) : string |
The file in which the snippet is found. |
|
identifier ( ) : string |
A unique identifier for the snippet. |
|
index ( ) : integer |
The Snippet Index |
|
insertAfterLine ( integer $line, string $content ) : void |
Inject new code after a given line. |
|
invoke ( $returnVar = null ) : mixed |
Eval the snippet and return the result. |
|
jsonSerialize ( ) |
|
|
line ( ) : integer |
The line number where the snippet's method or class is declared. |
|
name ( ) : string |
The snippet name |
|
regexReplace ( string $pattern, string $new ) : void |
Find something with a regex and replace it. |
|
replace ( string $old, string $new ) : void |
Replace a string in the snippet with a new one. |
|
setLine ( integer $line, string $content ) : void |
Replace a line with new code. |
|