$enabled = false
[line 41]
Is the fixer enabled and fixing a file?
Sniffs should check this value to ensure they are not doing extra processing to prepare for a fix when fixing is not required.
addContent [line 454]
void addContent(
int
$stackPtr, string
$content)
Adds content to the end of a token's current content.
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
string
$content
—
The content to add.
addContentBefore [line 470]
void addContentBefore(
int
$stackPtr, string
$content)
Adds content to the start of a token's current content.
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
string
$content
—
The content to add.
addNewline [line 423]
void addNewline(
int
$stackPtr)
Adds a newline to end of a token's content.
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
addNewlineBefore [line 438]
void addNewlineBefore(
int
$stackPtr)
Adds a newline to the start of a token's content.
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
beginChangeset [line 269]
Start recording actions for a changeset.
endChangeset [line 292]
Stop recording actions for a changeset, and apply logged changes.
fixFile [line 123]
Attempt to fix the file by processing it until no fixes are made.
generateDiff [line 193]
Generates a text diff of the original file and the new content.
getContents [line 233]
Get the current content of the file, as a string.
getFixCount [line 221]
Get a count of fixes that have been performed on the file.
This value is reset every time a new file is started, or an existing file is restarted.
getTokenContent [line 251]
string getTokenContent(
int
$stackPtr)
Get the current fixed content of a token.
This function takes changesets into account so should be used instead of directly accessing the token array.
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
replaceToken [line 335]
void replaceToken(
int
$stackPtr, string
$content)
Replace the entire contents of a token.
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
string
$content
—
The new content of the token.
startFile [line 103]
Starts fixing a new file.
Parameters:
substrToken [line 401]
void substrToken(
int
$stackPtr, int
$start, [int
$length = null])
Replace the content of a token with a part of its current content.
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
int
$start
—
The first character to keep.
int
$length
—
The number of chacters to keep. If NULL, the content of the token from $start to the end of the content is kept.