$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.
$loops = 0
[line 48]
The number of times we have looped over a file.
addContent [line 675]
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 691]
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 644]
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 659]
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 361]
Start recording actions for a changeset.
endChangeset [line 388]
Stop recording actions for a changeset, and apply logged changes.
fixFile [line 151]
Attempt to fix the file by processing it until no fixes are made.
generateDiff [line 240]
string generateDiff(
[string
$filePath = null], [boolean
$colors = true])
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.
boolean
$colors
—
Print colored output or not.
getContents [line 325]
Get the current content of the file, as a string.
getFixCount [line 313]
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 343]
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 438]
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 564]
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 127]
Starts fixing a new file.
Parameters:
substrToken [line 622]
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.