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


Classes:
Generic_Sniffs_Files_LineEndingsSniff
Generic_Sniffs_Files_LineLengthSniff
Generic_Sniffs_Formatting_MultipleStatementAlignmentSniff
Generic_Sniffs_Formatting_NoSpaceAfterCastSniff
Generic_Sniffs_Formatting_SpaceAfterCastSniff
Generic_Sniffs_Functions_OpeningFunctionBraceBsdAllmanSniff
Generic_Sniffs_Functions_OpeningFunctionBraceKernighanRitchieSniff
Generic_Sniffs_Metrics_CyclomaticComplexitySniff
Generic_Sniffs_Metrics_NestingLevelSniff
Generic_Sniffs_NamingConventions_UpperCaseConstantNameSniff
Generic_Sniffs_PHP_DisallowShortOpenTagSniff
Generic_Sniffs_PHP_ForbiddenFunctionsSniff
Generic_Sniffs_PHP_LowerCaseConstantSniff
Generic_Sniffs_PHP_UpperCaseConstantSniff
Generic_Sniffs_WhiteSpace_DisallowTabIndentSniff
Generic_Sniffs_WhiteSpace_ScopeIndentSniff
PEAR_Sniffs_Classes_ClassDeclarationSniff
PEAR_Sniffs_Commenting_ClassCommentSniff
PEAR_Sniffs_Commenting_FileCommentSniff
PEAR_Sniffs_Commenting_FunctionCommentSniff
PEAR_Sniffs_Commenting_InlineCommentSniff
PEAR_Sniffs_ControlStructures_ControlSignatureSniff
PEAR_Sniffs_Files_IncludingFileSniff
PEAR_Sniffs_Files_LineEndingsSniff
PEAR_Sniffs_Files_LineLengthSniff
PEAR_Sniffs_Functions_FunctionCallArgumentSpacingSniff
PEAR_Sniffs_Functions_FunctionCallSignatureSniff
PEAR_Sniffs_Functions_ValidDefaultValueSniff
PEAR_Sniffs_NamingConventions_ValidClassNameSniff
PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff
PEAR_Sniffs_NamingConventions_ValidVariableNameSniff
PEAR_Sniffs_WhiteSpace_ScopeClosingBraceSniff
PEAR_Sniffs_WhiteSpace_ScopeIndentSniff
PHP_CodeSniffer
PHP_CodeSniffer_CommentParser_AbstractDocElement
PHP_CodeSniffer_CommentParser_AbstractParser
PHP_CodeSniffer_CommentParser_ClassCommentParser
PHP_CodeSniffer_CommentParser_CommentElement
PHP_CodeSniffer_CommentParser_FunctionCommentParser
PHP_CodeSniffer_CommentParser_MemberCommentParser
PHP_CodeSniffer_CommentParser_PairElement
PHP_CodeSniffer_CommentParser_ParameterElement
PHP_CodeSniffer_CommentParser_ParserException
PHP_CodeSniffer_CommentParser_SingleElement
PHP_CodeSniffer_DocGenerators_Generator
PHP_CodeSniffer_DocGenerators_HTML
PHP_CodeSniffer_DocGenerators_Text
PHP_CodeSniffer_Exception
PHP_CodeSniffer_File
PHP_CodeSniffer_Standards_AbstractPatternSniff
PHP_CodeSniffer_Standards_AbstractScopeSniff
PHP_CodeSniffer_Standards_AbstractVariableSniff
PHP_CodeSniffer_Standards_CodingStandard
PHP_CodeSniffer_Standards_Generic_GenericCodingStandard
PHP_CodeSniffer_Standards_IncorrectPatternException
PHP_CodeSniffer_Standards_PEAR_PEARCodingStandard
PHP_CodeSniffer_Standards_PHPCS_PHPCSCodingStandard
PHP_CodeSniffer_Standards_Squiz_SquizCodingStandard
PHP_CodeSniffer_Standards_Zend_ZendCodingStandard
PHP_CodeSniffer_Tokens
Squiz_Sniffs_Arrays_ArrayBracketSpacingSniff
Squiz_Sniffs_Arrays_ArrayDeclarationSniff
Squiz_Sniffs_Classes_ClassDeclarationSniff
Squiz_Sniffs_Classes_ClassFileNameSniff
Squiz_Sniffs_Classes_LowercaseClassKeywordsSniff
Squiz_Sniffs_Classes_SelfMemberReferenceSniff
Squiz_Sniffs_Classes_ValidClassNameSniff
Squiz_Sniffs_Commenting_BlockCommentSniff
Squiz_Sniffs_Commenting_ClassCommentSniff
Squiz_Sniffs_Commenting_ClosingDeclarationCommentSniff
Squiz_Sniffs_Commenting_DocCommentAlignmentSniff
Squiz_Sniffs_Commenting_EmptyCatchCommentSniff
Squiz_Sniffs_Commenting_FileCommentSniff
Squiz_Sniffs_Commenting_FunctionCommentSniff
Squiz_Sniffs_Commenting_FunctionCommentThrowTagSniff
Squiz_Sniffs_Commenting_InlineCommentSniff
Squiz_Sniffs_Commenting_LongConditionClosingCommentSniff
Squiz_Sniffs_Commenting_PostStatementCommentSniff
Squiz_Sniffs_Commenting_VariableCommentSniff
Squiz_Sniffs_ControlStructures_ControlSignatureSniff
Squiz_Sniffs_ControlStructures_ElseIfDeclarationSniff
Squiz_Sniffs_ControlStructures_ForEachLoopDeclarationSniff
Squiz_Sniffs_ControlStructures_ForLoopDeclarationSniff
Squiz_Sniffs_ControlStructures_InlineControlStructureSniff
Squiz_Sniffs_ControlStructures_InlineIfDeclarationSniff
Squiz_Sniffs_ControlStructures_LowercaseDeclarationSniff
Squiz_Sniffs_ControlStructures_SwitchDeclarationSniff
Squiz_Sniffs_Files_FileExtensionSniff
Squiz_Sniffs_Files_LineEndingsSniff
Squiz_Sniffs_Files_LineLengthSniff
Squiz_Sniffs_Formatting_MultipleStatementAlignmentSniff
Squiz_Sniffs_Formatting_OperatorBracketSniff
Squiz_Sniffs_Formatting_OutputBufferingIndentSniff
Squiz_Sniffs_Functions_FunctionDeclarationArgumentSpacingSniff
Squiz_Sniffs_Functions_FunctionDeclarationSniff
Squiz_Sniffs_Functions_FunctionDuplicateArgumentSniff
Squiz_Sniffs_Functions_GlobalFunctionSniff
Squiz_Sniffs_Functions_LowercaseFunctionKeywordsSniff
Squiz_Sniffs_NamingConventions_ValidFunctionNameSniff
Squiz_Sniffs_NamingConventions_ValidVariableNameSniff
Squiz_Sniffs_Objects_ObjectInstantiationSniff
Squiz_Sniffs_Operators_ComparisonOperatorUsageSniff
Squiz_Sniffs_Operators_IncrementDecrementUsageSniff
Squiz_Sniffs_Operators_ValidLogicalOperatorsSniff
Squiz_Sniffs_PHP_CommentedOutCodeSniff
Squiz_Sniffs_PHP_DisallowCountInLoopsSniff
Squiz_Sniffs_PHP_DisallowInlineIfSniff
Squiz_Sniffs_PHP_DisallowMultipleAssignmentsSniff
Squiz_Sniffs_PHP_DisallowObEndFlushSniff
Squiz_Sniffs_PHP_EmbeddedPhpSniff
Squiz_Sniffs_PHP_EvalSniff
Squiz_Sniffs_PHP_ForbiddenFunctionsSniff
Squiz_Sniffs_PHP_GlobalKeywordSniff
Squiz_Sniffs_PHP_HeredocSniff
Squiz_Sniffs_PHP_InnerFunctionsSniff
Squiz_Sniffs_PHP_LowercasePHPFunctionsSniff
Squiz_Sniffs_PHP_NonExecutableCodeSniff
Squiz_Sniffs_Scope_MemberVarScopeSniff
Squiz_Sniffs_Scope_MethodScopeSniff
Squiz_Sniffs_Scope_StaticThisUsageSniff
Squiz_Sniffs_Strings_ConcatenationSpacingSniff
Squiz_Sniffs_Strings_DoubleQuoteUsageSniff
Squiz_Sniffs_Strings_EchoedStringsSniff
Squiz_Sniffs_WhiteSpace_CastSpacingSniff
Squiz_Sniffs_WhiteSpace_ControlStructureSpacingSniff
Squiz_Sniffs_WhiteSpace_FunctionClosingBraceSpaceSniff
Squiz_Sniffs_WhiteSpace_FunctionOpeningBraceSpaceSniff
Squiz_Sniffs_WhiteSpace_FunctionSpacingSniff
Squiz_Sniffs_WhiteSpace_LanguageConstructSpacingSniff
Squiz_Sniffs_WhiteSpace_MemberVarSpacingSniff
Squiz_Sniffs_WhiteSpace_ObjectOperatorSpacingSniff
Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff
Squiz_Sniffs_WhiteSpace_ScopeClosingBraceSniff
Squiz_Sniffs_WhiteSpace_ScopeIndentSniff
Squiz_Sniffs_WhiteSpace_ScopeKeywordSpacingSniff
Squiz_Sniffs_WhiteSpace_SemicolonSpacingSniff
Squiz_Sniffs_WhiteSpace_SuperfluousWhitespaceSniff
Zend_Sniffs_Debug_CodeAnalyzerSniff
Zend_Sniffs_Files_ClosingTagSniff
Zend_Sniffs_Files_LineLengthSniff
Zend_Sniffs_NamingConventions_ValidVariableNameSniff
Files:
AbstractDocElement.php
AbstractParser.php
AbstractPatternSniff.php
AbstractScopeSniff.php
AbstractVariableSniff.php
ArrayBracketSpacingSniff.php
ArrayDeclarationSniff.php
BlockCommentSniff.php
CastSpacingSniff.php
ClassCommentParser.php
ClassCommentSniff.php
ClassCommentSniff.php
ClassDeclarationSniff.php
ClassDeclarationSniff.php
ClassFileNameSniff.php
ClosingDeclarationCommentSniff.php
ClosingTagSniff.php
CodeAnalyzerSniff.php
CodeSniffer.php
CodingStandard.php
CommentedOutCodeSniff.php
CommentElement.php
ComparisonOperatorUsageSniff.php
ConcatenationSpacingSniff.php
ControlSignatureSniff.php
ControlSignatureSniff.php
ControlStructureSpacingSniff.php
CyclomaticComplexitySniff.php
DisallowCountInLoopsSniff.php
DisallowInlineIfSniff.php
DisallowMultipleAssignmentsSniff.php
DisallowObEndFlushSniff.php
DisallowShortOpenTagSniff.php
DisallowTabIndentSniff.php
DocCommentAlignmentSniff.php
DocElement.php
DoubleQuoteUsageSniff.php
EchoedStringsSniff.php
ElseIfDeclarationSniff.php
EmbeddedPhpSniff.php
EmptyCatchCommentSniff.php
EvalSniff.php
Exception.php
File.php
FileCommentSniff.php
FileCommentSniff.php
FileExtensionSniff.php
ForbiddenFunctionsSniff.php
ForbiddenFunctionsSniff.php
ForEachLoopDeclarationSniff.php
ForLoopDeclarationSniff.php
FunctionCallArgumentSpacingSniff.php
FunctionCallSignatureSniff.php
FunctionClosingBraceSpaceSniff.php
FunctionCommentParser.php
FunctionCommentSniff.php
FunctionCommentSniff.php
FunctionCommentThrowTagSniff.php
FunctionDeclarationArgumentSpacingSniff.php
FunctionDeclarationSniff.php
FunctionDuplicateArgumentSniff.php
FunctionOpeningBraceSpaceSniff.php
FunctionSpacingSniff.php
Generator.php
GenericCodingStandard.php
GlobalFunctionSniff.php
GlobalKeywordSniff.php
HeredocSniff.php
HTML.php
IncludingFileSniff.php
IncorrectPatternException.php
IncrementDecrementUsageSniff.php
InlineCommentSniff.php
InlineCommentSniff.php
InlineControlStructureSniff.php
InlineIfDeclarationSniff.php
InnerFunctionsSniff.php
LanguageConstructSpacingSniff.php
LineEndingsSniff.php
LineEndingsSniff.php
LineEndingsSniff.php
LineLengthSniff.php
LineLengthSniff.php
LineLengthSniff.php
LineLengthSniff.php
LongConditionClosingCommentSniff.php
LowercaseClassKeywordsSniff.php
LowerCaseConstantSniff.php
LowercaseDeclarationSniff.php
LowercaseFunctionKeywordsSniff.php
LowercasePHPFunctionsSniff.php
MemberCommentParser.php
MemberVarScopeSniff.php
MemberVarSpacingSniff.php
MethodScopeSniff.php
MultipleStatementAlignmentSniff.php
MultipleStatementAlignmentSniff.php
NestingLevelSniff.php
NonExecutableCodeSniff.php
NoSpaceAfterCastSniff.php
ObjectInstantiationSniff.php
ObjectOperatorSpacingSniff.php
OpeningFunctionBraceBsdAllmanSniff.php
OpeningFunctionBraceKernighanRitchieSniff.php
OperatorBracketSniff.php
OperatorSpacingSniff.php
OutputBufferingIndentSniff.php
PairElement.php
ParameterElement.php
ParserException.php
PEARCodingStandard.php
PHPCSCodingStandard.php
PostStatementCommentSniff.php
ScopeClosingBraceSniff.php
ScopeClosingBraceSniff.php
ScopeIndentSniff.php
ScopeIndentSniff.php
ScopeIndentSniff.php
ScopeKeywordSpacingSniff.php
SelfMemberReferenceSniff.php
SemicolonSpacingSniff.php
SingleElement.php
Sniff.php
SpaceAfterCastSniff.php
SquizCodingStandard.php
StaticThisUsageSniff.php
SuperfluousWhitespaceSniff.php
SwitchDeclarationSniff.php
Text.php
Tokens.php
UpperCaseConstantNameSniff.php
UpperCaseConstantSniff.php
ValidClassNameSniff.php
ValidClassNameSniff.php
ValidDefaultValueSniff.php
ValidFunctionNameSniff.php
ValidFunctionNameSniff.php
ValidLogicalOperatorsSniff.php
ValidVariableNameSniff.php
ValidVariableNameSniff.php
ValidVariableNameSniff.php
VariableCommentSniff.php
ZendCodingStandard.php

Class: PHP_CodeSniffer

Source Location: /PHP_CodeSniffer-1.0.1/CodeSniffer.php


Inherited Variables

Inherited Methods


Class Details

[line 61]
PHP_CodeSniffer tokenises PHP code and detects violations of a defined set of coding standards.

Standards are specified by classes that implement the PHP_CodeSniffer_Sniff interface. A sniff registers what token types it wishes to listen for, then PHP_CodeSniffer encounters that token, the sniff is invoked and passed information about where the token was found in the stack, and the token stack itself.

Sniff files and their containing class must be prefixed with Sniff, and have an extension of .php.

Multiple PHP_CodeSniffer operations can be performed by re-calling the process function with different parameters.



[ Top ]


Class Variables

$allowedFileExtensions = array(
'php',
'inc',
)

[line 104]

An array of extensions for files we will check.
  • Access: protected

Type: array


[ Top ]

$allowedTypes = array(
'array',
'boolean',
'float',
'integer',
'mixed',
'object',
'string',
)

[line 114]

An array of variable types for param/var we will check.
  • Access: public

Type: array(string)


[ Top ]

$file = array()

[line 69]

The file or directory that is currently being processed.
  • Access: protected

Type: string


[ Top ]

$files = array()

[line 83]

The files that have been processed.
  • Access: protected

Type: array(PHP_CodeSniffer_File)


[ Top ]

$ignorePatterns = array()

[line 97]

An array of patterns to use for skipping files.
  • Access: protected

Type: array()


[ Top ]

$listeners = array()

[line 90]

The listeners array.
  • Access: protected

Type: array(PHP_CodeSniffer_Sniff)


[ Top ]

$standardDir = ''

[line 76]

The directory where to search for tests.
  • Access: protected

Type: string


[ Top ]



Method Detail

__construct (Constructor) [line 137]

PHP_CodeSniffer __construct( [int $verbosity = 0], [int $tabWidth = 0])

Constructs a PHP_CodeSniffer object.

Parameters:

int $verbosity — The verbosity level. 1: Print progress information. 2: Print developer debug information.
int $tabWidth — The number of spaces each tab represents. If greater than zero, tabs will be replaced by spaces before testing each file.

[ Top ]

autoload [line 156]

void autoload( string $className)

Autoload static method for loading classes and interfaces.
  • Access: public

Parameters:

string $className — The name of the class or interface.

[ Top ]

generateDocs [line 1007]

void generateDocs( string $standard, [array $sniffs = array()], [string $generator = 'Text'])

Generates documentation for a coding standard.
  • Access: public

Parameters:

string $standard — The standard to generate docs for
array $sniffs — A list of sniffs to limit the docs to.
string $generator — The name of the generator class to use.

[ Top ]

getAllConfigData [line 1572]

string getAllConfigData( )

Get all config data in an array.

[ Top ]

getConfigData [line 1490]

string getConfigData( string $key)

Get a single config value.

Config data is stored in the data dir, in a file called CodeSniffer.conf. It is a simple PHP array.


Parameters:

string $key — The name of the config value.

[ Top ]

getFiles [line 1024]

array(PHP_CodeSniffer_File) getFiles( )

Returns the PHP_CodeSniffer file objects.
  • Access: public

[ Top ]

getInstalledStandards [line 1418]

array getInstalledStandards( [boolean $includeGeneric = false], [string $standardsDir = ''])

Get a list of all coding standards installed.

Coding standards are directories located in the CodeSniffer/Standards directory. Valid coding standards include a Sniffs subdirectory.


Parameters:

boolean $includeGeneric — If true, the special "Generic" coding standard will be included if installed.
string $standardsDir — A specific directory to look for standards in. If not specified, PHP_CodeSniffer will look in its default location.

[ Top ]

getSniffFiles [line 354]

array getSniffFiles( string $dir, [string $standard = null])

Return a list of sniffs that a coding standard has defined.

Sniffs are found by recursing the standard directory and also by asking the standard for included sniffs.

  • Throws: PHP_CodeSniffer_Exception If an included or excluded sniff does not exist.
  • Access: public

Parameters:

string $dir — The directory where to look for the files.
string $standard — The name of the coding standard. If NULL, no included sniffs will be checked for.

[ Top ]

getSniffs [line 1036]

array(PHP_CodeSniffer_Sniff) getSniffs( )

Gets the array of PHP_CodeSniffer_Sniff's.
  • Access: public

[ Top ]

isCamelCaps [line 1237]

boolean isCamelCaps( string $string, [boolean $classFormat = false], [boolean $public = true], [boolean $strict = true])

Returns true if the specified string is in the camel caps format.
  • Access: public

Parameters:

string $string — The string the verify.
boolean $classFormat — If true, check to see if the string is in the class format. Class format strings must start with a capital letter and contain no underscores.
boolean $public — If true, the first character in the string must be an a-z character. If false, the character must be an underscore. This argument is only applicable if $classFormat is false.
boolean $strict — If true, the string must not have two captial letters next to each other. If false, a relaxed camel caps policy is used to allow for acronyms.

[ Top ]

isInstalledStandard [line 1462]

boolean isInstalledStandard( string $standard)

Determine if a standard is installed.

Coding standards are directories located in the CodeSniffer/Standards directory. Valid coding standards include a Sniffs subdirectory.


Parameters:

string $standard — The name of the coding standard.

[ Top ]

isUnderscoreName [line 1303]

boolean isUnderscoreName( string $string)

Returns true if the specified string is in the underscore caps format.
  • Access: public

Parameters:

string $string — The string to verify.

[ Top ]

prepareErrorReport [line 590]

array prepareErrorReport( [boolean $showWarnings = true])

Pre-process and package errors and warnings for all files.

Used by error reports to get a packaged list of all errors and warnings in each file.

  • Access: public

Parameters:

boolean $showWarnings — Show warnings as well as errors.

[ Top ]

printCheckstyleErrorReport [line 741]

int printCheckstyleErrorReport( [boolean $showWarnings = true])

Prints all errors and warnings for each file processed, in a Checkstyle XML format.

Errors and warnings are displayed together, grouped by file.

  • Return: The number of error and warning messages shown.
  • Access: public

Parameters:

boolean $showWarnings — Show warnings as well as errors.

[ Top ]

printCSVErrorReport [line 786]

int printCSVErrorReport( [boolean $showWarnings = true])

Prints all errors and warnings for each file processed, in a CSV format.
  • Return: The number of error and warning messages shown.
  • Access: public

Parameters:

boolean $showWarnings — Show warnings as well as errors.

[ Top ]

printErrorReport [line 823]

int printErrorReport( [boolean $showWarnings = true])

Prints all errors and warnings for each file processed.

Errors and warnings are displayed together, grouped by file.

  • Return: The number of error and warning messages shown.
  • Access: public

Parameters:

boolean $showWarnings — Show warnings as well as errors.

[ Top ]

printErrorReportSummary [line 920]

int printErrorReportSummary( [boolean $showWarnings = true])

Prints a summary of errors and warnings for each file processed.

If verbose output is enabled, results are shown for all files, even if they have no errors or warnings. If verbose output is disabled, we only show files that have at least one warning or error.

  • Return: The number of error and warning messages shown.
  • Access: public

Parameters:

boolean $showWarnings — Show warnings as well as errors.

[ Top ]

printXMLErrorReport [line 694]

int printXMLErrorReport( [boolean $showWarnings = true])

Prints all errors and warnings for each file processed, in an XML format.

Errors and warnings are displayed together, grouped by file.

  • Return: The number of error and warning messages shown.
  • Access: public

Parameters:

boolean $showWarnings — Show warnings as well as errors.

[ Top ]

process [line 225]

void process( string|array $files, string $standard, [array $sniffs = array()], [boolean $local = false])

Processes the files/directories that PHP_CodeSniffer was constructed with.
  • Throws: PHP_CodeSniffer_Exception If files or standard are invalid.
  • Access: public

Parameters:

string|array $files — The files and directories to process. For directories, each sub directory will also be traversed for source files.
string $standard — The set of code sniffs we are testing against.
array $sniffs — The sniff names to restrict the allowed listeners to.
boolean $local — If true, don't recurse into directories.

[ Top ]

processFile [line 531]

void processFile( string $file)

Run the code sniffs over a single given file.

Processes the file and runs the PHP_CodeSniffer sniffs to verify that it conforms with the standard.

  • Throws: PHP_CodeSniffer_Exception If the file could not be processed.
  • Access: protected

Parameters:

string $file — The file to process.

[ Top ]

processFiles [line 485]

void processFiles( string $dir, [boolean $local = false])

Run the code sniffs over each file in a given directory.

Recusively reads the specified directory and performs the PHP_CodeSniffer sniffs on each source file found within the directories.

  • Throws: Exception If there was an error opening the directory.
  • Access: protected

Parameters:

string $dir — The directory to process.
boolean $local — If true, only process files in this directory, not sub directories.

[ Top ]

registerTokenListeners [line 291]

void registerTokenListeners( string $standard, [array $sniffs = array()])

Registers installed sniffs in the coding standard being used.

Traverses the standard directory for classes that implement the PHP_CodeSniffer_Sniff interface asks them to register. Each of the sniff's class names must be exact as the basename of the sniff file.

  • Throws: PHP_CodeSniffer_Exception If any of the tests failed in the registration process.
  • Access: protected

Parameters:

string $standard — The name of the coding standard we are checking.
array $sniffs — The sniff names to restrict the allowed listeners to.

[ Top ]

resolveSimpleToken [line 1129]

array resolveSimpleToken( string $token)

Converts simple tokens into a format that conforms to complex tokens produced by token_get_all().

Simple tokens are tokens that are not in array form when produced from token_get_all().

  • Return: The new token in array format.
  • Access: public

Parameters:

string $token — The simple token to convert.

[ Top ]

resolveTstringToken [line 1086]

array resolveTstringToken( array $token)

Converts T_STRING tokens into more usable token names.

The token should be produced using the token_get_all() function. Currently, not all T_STRING tokens are converted.

  • Return: The new token.
  • Access: public

Parameters:

string|array $token — The T_STRING token to convert as constructed by token_get_all().

[ Top ]

setAllowedFileExtensions [line 187]

void setAllowedFileExtensions( array $extensions)

Sets an array of file extensions that we will allow checking of.
  • Access: public

Parameters:

array $extensions — An array of file extensions.

[ Top ]

setConfigData [line 1525]

boolean setConfigData( string $key, string|null $value, [boolean $temp = false])

Set a single config value.

Config data is stored in the data dir, in a file called CodeSniffer.conf. It is a simple PHP array.


Parameters:

string $key — The name of the config value.
string|null $value — The value to set. If null, the config entry is deleted, reverting it to the default value.
boolean $temp — Set this config data temporarily for this script run. This will not write the config data to the config file.

[ Top ]

setIgnorePatterns [line 203]

void setIgnorePatterns( array $patterns)

Sets an array of ignore patterns that we use to skip files and folders.

Patterns are not case sensitive.

  • Access: public

Parameters:

array $patterns — An array of ignore patterns.

[ Top ]

standardiseToken [line 1054]

array standardiseToken( string|array $token)

Takes a token produced from
and produces a more uniform token.

Note that this method also resolves T_STRING tokens into more descrete types, therefore there is no need to call resolveTstringToken()

  • Return: The new token.
  • Access: public

Parameters:

string|array $token — The token to convert.

[ Top ]

suggestType [line 1340]

string suggestType( string $varType)

Returns a valid variable type for param/var tag.

If type is not one of the standard type, it must be a custom type. Returns the correct type name suggestion if type name is invalid.

  • Access: public

Parameters:

string $varType — The variable type to process.

[ Top ]


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

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