Свойство | Type | Description | |
---|---|---|---|
$enabled | boolean | Sniffs should check this value to ensure they are not doing extra processing to prepare for a fix when fixing is not required. | |
$loops | integer | The number of times we have looped over a file. |
Méthode | Description | |
---|---|---|
addContent ( integer $stackPtr, string $content ) : boolean | Adds content to the end of a token's current content. | |
addContentBefore ( integer $stackPtr, string $content ) : boolean | Adds content to the start of a token's current content. | |
addNewline ( integer $stackPtr ) : boolean | Adds a newline to end of a token's content. | |
addNewlineBefore ( integer $stackPtr ) : boolean | Adds a newline to the start of a token's content. | |
beginChangeset ( ) : void | Start recording actions for a changeset. | |
endChangeset ( ) : boolean | Stop recording actions for a changeset, and apply logged changes. | |
fixFile ( ) : boolean | Attempt to fix the file by processing it until no fixes are made. | |
generateDiff ( string $filePath = null, boolean $colors = true ) : string | Generates a text diff of the original file and the new content. | |
getContents ( ) : string | Get the current content of the file, as a string. | |
getFixCount ( ) : integer | Get a count of fixes that have been performed on the file. | |
getTokenContent ( integer $stackPtr ) : string | Get the current fixed content of a token. | |
replaceToken ( integer $stackPtr, string $content ) : boolean | Replace the entire contents of a token. | |
revertToken ( integer $stackPtr ) : boolean | Reverts the previous fix made to a token. | |
rollbackChangeset ( ) : void | Stop recording actions for a changeset, and discard logged changes. | |
startFile ( PHP_CodeSniffer_File $phpcsFile ) : void | Starts fixing a new file. | |
substrToken ( integer $stackPtr, integer $start, integer $length = null ) : boolean | Replace the content of a token with a part of its current content. |
public addNewline ( integer $stackPtr ) : boolean | ||
$stackPtr | integer | The position of the token in the token stack. |
Résultat | boolean | If the change was accepted. |
public addNewlineBefore ( integer $stackPtr ) : boolean | ||
$stackPtr | integer | The position of the token in the token stack. |
Résultat | boolean | If the change was accepted. |
public beginChangeset ( ) : void | ||
Résultat | void |
public endChangeset ( ) : boolean | ||
Résultat | boolean |
public getContents ( ) : string | ||
Résultat | string |
public getFixCount ( ) : integer | ||
Résultat | integer |
public getTokenContent ( integer $stackPtr ) : string | ||
$stackPtr | integer | The position of the token in the token stack. |
Résultat | string |
public revertToken ( integer $stackPtr ) : boolean | ||
$stackPtr | integer | The position of the token in the token stack. |
Résultat | boolean | If a change was reverted. |
public rollbackChangeset ( ) : void | ||
Résultat | void |
public substrToken ( integer $stackPtr, integer $start, integer $length = null ) : boolean | ||
$stackPtr | integer | The position of the token in the token stack. |
$start | integer | The first character to keep. |
$length | integer | The number of chacters to keep. If NULL, the content of the token from $start to the end of the content is kept. |
Résultat | boolean | If the change was accepted. |
public bool $enabled | ||
Résultat | boolean |
public int $loops | ||
Résultat | integer |