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: Tokenizer

Source Location: /PHP_CodeSniffer-3.0.0RC2/src/Tokenizers/Tokenizer.php

Class Overview


The base tokenizer class.


Author(s):

Copyright:

  • 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)

Variables

Methods


Child classes:

PHP
Tokenizes PHP code.
JS
Tokenizes JS code.

Inherited Variables

Inherited Methods


Class Details

[line 15]
The base tokenizer class.


[ Top ]


Class Variables

$config = null

[line 23]

The config data for the run.
  • Access: protected

Type: \PHP_CodeSniffer\Config


[ Top ]

$eolChar = array()

[line 30]

The EOL char used in the content.
  • Access: protected

Type: string


[ Top ]

$ignoredLines = array()

[line 51]

A list of lines being ignored due to error suppression comments.
  • Access: public

Type: array


[ Top ]

$knownLengths = array()

[line 44]

Known lengths of tokens.
  • Var: int>
  • Access: public

Type: array


[ Top ]

$tokens = array()

[line 37]

A token-based representation of the content.
  • Access: protected

Type: array


[ Top ]



Method Detail

__construct (Constructor) [line 64]

void __construct( string $content, \PHP_CodeSniffer\Config $config, [string $eolChar = '\n'])

Initialise and run the tokenizer.
  • Throws: TokenizerException If the file appears to be minified.
  • Access: public

Overridden in child classes as:

CSS::__construct()
Initialise the tokenizer.
JS::__construct()
Initialise the tokenizer.

Parameters:

string $content — The content to tokenize,
string $eolChar — The EOL char used in the content.
\PHP_CodeSniffer\Config $config — | null $config The config data for the run.

[ Top ]

getTokens [line 116]

array getTokens( )

Gets the array of tokens.
  • Access: public

[ Top ]

isMinifiedContent [line 95]

boolean isMinifiedContent( string $content, [string $eolChar = '\n'])

Checks the content to see if it looks minified.
  • Access: protected

Parameters:

string $content — The content to tokenize,
string $eolChar — The EOL char used in the content.

[ Top ]

processAdditional [line 138]

void processAdditional( )

Performs additional processing after main tokenizing.
  • Abstract:
  • Access: protected

Overridden in child classes as:

PHP::processAdditional()
Performs additional processing after main tokenizing.
CSS::processAdditional()
Performs additional processing after main tokenizing.
JS::processAdditional()
Performs additional processing after main tokenizing.

[ Top ]

replaceTabsInToken [line 266]

void replaceTabsInToken( &$token, [string $prefix = ' '], [string $padding = ' '], array $token)

Replaces tabs in original token content with spaces.

Each tab can represent between 1 and $config->tabWidth spaces, so this cannot be a straight string replace. The original content is placed into an orig_content index and the new token length is also set in the length index.

  • Access: public

Parameters:

array $token — The token to replace tabs inside.
string $prefix — The character to use to represent the start of a tab.
string $padding — The character to use to represent the end of a tab.
&$token

[ Top ]

tokenize [line 130]

array tokenize( string $string)

Creates an array of tokens when given some content.
  • Abstract:
  • Access: protected

Overridden in child classes as:

PHP::tokenize()
Creates an array of tokens when given some PHP code.
CSS::tokenize()
Creates an array of tokens when given some CSS code.
JS::tokenize()
Creates an array of tokens when given some JS code.

Parameters:

string $string — The string to tokenize.

[ Top ]


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

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