apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]
Packages:
PHP_CodeSniffer


Classes:
PHP_CodeSniffer
AbstractPatternSniff
AbstractScopeSniff
AbstractVariableSniff
AjaxNullComparisonSniff
ArrayBracketSpacingSniff
ArrayDeclarationSniff
AssignThisSniff
Autoload
BacktickOperatorSniff
BlockCommentSniff
BrowserSpecificStylesSniff
ByteOrderMarkSniff
Cache
CallTimePassByReferenceSniff
CamelCapsFunctionNameSniff
CamelCapsMethodNameSniff
CastSpacingSniff
Cbf
CharacterBeforePHPOpeningTagSniff
Checkstyle
ClassCommentSniff
ClassDeclarationSniff
ClassDefinitionClosingBraceSpaceSniff
ClassDefinitionNameSpacingSniff
ClassDefinitionOpeningBraceSpaceSniff
ClassFileNameSniff
ClosingDeclarationCommentSniff
ClosingPHPTagSniff
ClosingTagSniff
ClosureLinterSniff
CodeAnalyzerSniff
ColonSpacingSniff
ColourDefinitionSniff
Comment
CommentedOutCodeSniff
Common
ComparisonOperatorUsageSniff
ConcatenationSpacingSniff
Config
ConstructorNameSniff
ControlSignatureSniff
ControlStructureSpacingSniff
CreateWidgetTypeCallbackSniff
CSS
CSSLintSniff
Csv
CyclomaticComplexitySniff
DebugCodeSniff
DeprecatedFunctionsSniff
Diff
DisallowAlternativePHPTagsSniff
DisallowBooleanStatementSniff
DisallowComparisonAssignmentSniff
DisallowInlineIfSniff
DisallowLongArraySyntaxSniff
DisallowMultipleAssignmentsSniff
DisallowMultipleStatementsSniff
DisallowMultipleStyleDefinitionsSniff
DisallowNewWidgetSniff
DisallowObEndFlushSniff
DisallowObjectStringIndexSniff
DisallowSelfActionsSniff
DisallowShortArraySyntaxSniff
DisallowShortOpenTagSniff
DisallowSizeFunctionsInLoopsSniff
DisallowSpaceIndentSniff
DisallowTabIndentSniff
DiscouragedFunctionsSniff
DocCommentAlignmentSniff
DocCommentSniff
DoubleQuoteUsageSniff
DummyFile
DuplicateClassDefinitionSniff
DuplicateClassNameSniff
DuplicatePropertySniff
DuplicateStyleDefinitionSniff
EchoedStringsSniff
ElseIfDeclarationSniff
Emacs
EmbeddedPhpSniff
EmptyCatchCommentSniff
EmptyClassDefinitionSniff
EmptyStatementSniff
EmptyStyleDefinitionSniff
EndFileNewlineSniff
EndFileNoNewlineSniff
EvalObjectFactorySniff
EvalSniff
ExactMatch
File
FileCommentSniff
FileExtensionSniff
FileList
Filter
FirebugConsoleSniff
Fixer
FixmeSniff
ForbiddenFunctionsSniff
ForbiddenStylesSniff
ForEachLoopDeclarationSniff
ForLoopDeclarationSniff
ForLoopShouldBeWhileLoopSniff
ForLoopWithTestFunctionCallSniff
Full
FunctionCallArgumentSpacingSniff
FunctionCallSignatureSniff
FunctionClosingBraceSniff
FunctionClosingBraceSpaceSniff
FunctionCommentSniff
FunctionCommentThrowTagSniff
FunctionDeclarationArgumentSpacingSniff
FunctionDeclarationSniff
FunctionDuplicateArgumentSniff
FunctionOpeningBraceSpaceSniff
FunctionSpacingSniff
Generator
GetRequestDataSniff
Gitblame
GitModified
GlobalFunctionSniff
GlobalKeywordSniff
HeredocSniff
Hgblame
HTML
IncludeOwnSystemSniff
IncludeSystemSniff
IncludingFileSniff
IncrementDecrementUsageSniff
IndentationSniff
Info
InlineCommentSniff
InlineControlStructureSniff
InlineHTMLSniff
InlineIfDeclarationSniff
InnerFunctionsSniff
JavaScriptLintSniff
JoinStringsSniff
JS
JSHintSniff
JSLintSniff
Json
JumbledIncrementerSniff
Junit
LanguageConstructSpacingSniff
LineEndingsSniff
LineLengthSniff
LocalFile
LogicalOperatorSpacingSniff
LongConditionClosingCommentSniff
LowercaseClassKeywordsSniff
LowerCaseConstantSniff
LowercaseDeclarationSniff
LowercasedFilenameSniff
LowercaseFunctionKeywordsSniff
LowerCaseKeywordSniff
LowercasePHPFunctionsSniff
LowercaseStyleDefinitionSniff
Markdown
MemberVarScopeSniff
MemberVarSpacingSniff
MethodDeclarationSniff
MethodScopeSniff
MissingColonSniff
MultiLineAssignmentSniff
MultiLineConditionSniff
MultiLineFunctionDeclarationSniff
MultipleStatementAlignmentSniff
NamedColoursSniff
NamespaceDeclarationSniff
NestingLevelSniff
NonExecutableCodeSniff
NoSilencedErrorsSniff
NoSpaceAfterCastSniff
Notifysend
ObjectInstantiationSniff
ObjectMemberCommaSniff
ObjectOperatorIndentSniff
ObjectOperatorSpacingSniff
OneClassPerFileSniff
OneInterfacePerFileSniff
OneTraitPerFileSniff
OpacitySniff
OpeningBraceSameLineSniff
OpeningFunctionBraceBsdAllmanSniff
OpeningFunctionBraceKernighanRitchieSniff
OperatorBracketSniff
OperatorSpacingSniff
PHP
PostStatementCommentSniff
PropertyDeclarationSniff
PropertyLabelSpacingSniff
Reporter
ReturnFunctionValueSniff
Ruleset
Runner
RuntimeException
SAPIUsageSniff
ScopeClosingBraceSniff
ScopeIndentSniff
ScopeKeywordSpacingSniff
SelfMemberReferenceSniff
SemicolonSpacingSniff
ShorthandSizeSniff
SideEffectsSniff
Source
SpaceAfterCastSniff
SpaceAfterNotSniff
Standards
StaticThisUsageSniff
SubversionPropertiesSniff
Summary
SuperfluousWhitespaceSniff
Svnblame
SwitchDeclarationSniff
SyntaxSniff
Text
Timing
TodoSniff
Tokenizer
TokenizerException
Tokens
UnconditionalIfStatementSniff
UnnecessaryFinalModifierSniff
UnnecessaryStringConcatSniff
UnusedFunctionParameterSniff
UnusedSystemSniff
UpperCaseConstantNameSniff
UpperCaseConstantSniff
UseDeclarationSniff
UselessOverridingMethodSniff
ValidClassNameSniff
ValidDefaultValueSniff
ValidFunctionNameSniff
ValidLogicalOperatorsSniff
ValidVariableNameSniff
VariableCommentSniff
VersionControl
Xml

Class: Fixer

Source Location: /PHP_CodeSniffer-3.0.0RC2/src/Fixer.php


Inherited Variables

Inherited Methods


Class Details

[line 18]
A helper class for fixing errors.

Provides helper functions that act upon a token array and modify the file content.



[ Top ]


Class Variables

$enabled = false

[line 30]

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.

  • Access: public

Type: boolean


[ Top ]

$loops = 0

[line 37]

The number of times we have looped over a file.
  • Access: public

Type: integer


[ Top ]



Method Detail

addContent [line 691]

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.

[ Top ]

addContentBefore [line 707]

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.

[ Top ]

addNewline [line 660]

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.

[ Top ]

addNewlineBefore [line 675]

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.

[ Top ]

beginChangeset [line 342]

void beginChangeset( )

Start recording actions for a changeset.
  • Access: public

[ Top ]

endChangeset [line 369]

boolean endChangeset( )

Stop recording actions for a changeset, and apply logged changes.
  • Access: public

[ Top ]

fixFile [line 140]

boolean fixFile( )

Attempt to fix the file by processing it until no fixes are made.
  • Access: public

[ Top ]

generateDiff [line 229]

string generateDiff( [string $filePath = null], [boolean $colors = true])

Generates a text diff of the original file and the new content.
  • Access: public

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.

[ Top ]

getContents [line 306]

string getContents( )

Get the current content of the file, as a string.
  • Access: public

[ Top ]

getFixCount [line 294]

int getFixCount( )

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.

  • Access: public

[ Top ]

getTokenContent [line 324]

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.

  • Access: public

Parameters:

int $stackPtr — The position of the token in the token stack.

[ Top ]

replaceToken [line 454]

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.

[ Top ]

revertToken [line 580]

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.

[ Top ]

rollbackChangeset [line 416]

void rollbackChangeset( )

Stop recording actions for a changeset, and discard logged changes.
  • Access: public

[ Top ]

startFile [line 116]

void startFile( File $phpcsFile)

Starts fixing a new file.
  • Access: public

Parameters:

\PHP_CodeSniffer\Files\File $phpcsFile — The file being fixed.

[ Top ]

substrToken [line 638]

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.

[ Top ]


Documentation generated on 2019年3月11日 14:49:41 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.

AltStyle によって変換されたページ (->オリジナル) /