Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (10)

View Page History
These tests are called "Sniffs" and include the following:

h2. Classes Sniffs
* *ClassFileNameSniff:* Tests that the file name and the name of the class contained within the file match
* *LowercaseClassKeywordsSniff:* Ensures all class keywords are lowercase

h2. Commenting Sniffs
* *InlineCommentSniff:* Checks that no perl-style comments (#)are used

h2. Controlstructure Sniffs
* *ElseIfDeclarationSniff:* Verifies that there are not elseif statements. The else and the if should be separated by a space
* *ForLoopDeclarationSniff:* Verifies that there is a space between each condition of for loops
* *ForEachLoopDeclarationSniff:* Verifies that there is a space between each condition of foreach loops
* *LowercaseDeclarationSniff:* Ensures all control structure keywords are lowercase
* *SwitchDeclarationSniff:* Ensures all the breaks and cases are aligned correctly according to their parent switch's alignment and enforces other switch formatting

h2. File Sniffs
* *ClosingTagSniff:* Checks that the file does not include a closing tag wether at file end nor inline for output purposes
h2. Function Sniffs
* *GlobalFunctionSniff:* Tests for functions outside of classes
* *LowercaseKeywordsSniff:* Ensures all class keywords are lowercase
* *OpeningFunctionBraceSniff:* Checks that the opening brace of a function is on the line after the function declaration

* *ValidClassNameSniff:* Ensures class and interface names start with a capital letter and use _ separators

h2. Operator Sniffs
* *IncrementDecrementUsageSniff:* Tests that the ++ operators are used when possible

h2. PHP Sniffs
* *DisallowObEndFlushSniff:* Disallow ob_end_flush, use ob_get_contents() and ob_end_clean() instead
* *DisallowShortOpenTagSniff:* Makes sure that shorthand PHP open tags are not used ("<?"), but allows open tag with echo ("<?="). short_open_tag must be set to true for this test to work
* *ForbiddenFunctionsSniff:* Discourages the use of alias functions that are kept in PHP for compatibility with older versions. Can be used to forbid the use of any function
* *GlobalKeywordSniff:* Stops the usage of the "global" keyword.
* *NonExecutableCodeSniff:* Warns about code that can never been executed. This happens when a function returns before the code, or a break ends execution of a statement etc

h2. String Sniffs
* *EchoedStringsSniff:* Makes sure that any strings that are "echoed" are not enclosed in brackets like a function call

h2. Whitespace Sniffs
* *DisallowTabSniff:* Checks if tabs are used and errors if any are found
* *LanguageConstructSpacingSniff:* Ensures all language constructs (without brackets) contain a single space between themselves and their content
* *SemicolonSpacingSniff:* Ensure there is no whitespace before a semicolon