$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 616]
bool addContent(
int
$stackPtr, string
$content)
Adds content to the end of a token's current content.
- Return: If the change was accepted.
- Access: public
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
string
$content
—
The content to add.
addContentBefore [line 632]
bool addContentBefore(
int
$stackPtr, string
$content)
Adds content to the start of a token's current content.
- Return: If the change was accepted.
- Access: public
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
string
$content
—
The content to add.
addNewline [line 585]
bool addNewline(
int
$stackPtr)
Adds a newline to end of a token's content.
- Return: If the change was accepted.
- Access: public
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
addNewlineBefore [line 600]
bool addNewlineBefore(
int
$stackPtr)
Adds a newline to the start of a token's content.
- Return: If the change was accepted.
- Access: public
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
beginChangeset [line 324]
Start recording actions for a changeset.
endChangeset [line 347]
Stop recording actions for a changeset, and apply logged changes.
fixFile [line 144]
Attempt to fix the file by processing it until no fixes are made.
generateDiff [line 231]
string generateDiff(
[string
$filePath = null])
Generates a text diff of the original file and the new content.
Parameters:
string
$filePath
—
Optional file path to diff the file against. If not specified, the original version of the file will be used.
getContents [line 288]
Get the current content of the file, as a string.
getFixCount [line 276]
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 306]
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 393]
bool replaceToken(
int
$stackPtr, string
$content)
Replace the entire contents of a token.
- Return: If the change was accepted.
- Access: public
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
string
$content
—
The new content of the token.
revertToken [line 505]
bool revertToken(
int
$stackPtr)
Reverts the previous fix made to a token.
- Return: If a change was reverted.
- Access: public
Parameters:
int
$stackPtr
—
The position of the token in the token stack.
startFile [line 120]
Starts fixing a new file.
Parameters:
substrToken [line 563]
bool substrToken(
int
$stackPtr, int
$start, [int
$length = null])
Replace the content of a token with a part of its current content.
- Return: If the change was accepted.
- Access: public
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.