►NAllGood | |
CDemo | |
►NAllSorted | |
CDemo | |
►NAnotherExample | |
CDemo | |
CDemo2 | |
►NExample | |
CStuff | |
►NExampleNoIndent | |
CDemo | |
►NExampleWithSpaces | |
CDemo | |
►NExampleWithTabs | |
CDemo | |
►NFoo | |
CBar | |
►NFooBar | |
CBarFoo | |
CCommentProps | |
CFoo | |
CUnusedUseTest | |
►NMediaWiki | |
►NSniffs | |
►NAlternativeSyntax | |
CLeadingZeroInFloatSniff | |
CUnicodeEscapeSniff | |
►NArrays | |
CAlphabeticArraySortSniff | |
CTrailingCommaSniff | Sniff to enforce the presence or absence of trailing commas in single- and multi-line arrays |
►NClasses | |
CFullQualifiedClassNameSniff | Custom sniff that disallows full qualified class names outside of the "use …" section |
CUnsortedUseStatementsSniff | |
CUnusedUseStatementSniff | |
►NCommenting | Detect and fix the inline comments start or end with multiple asterisks |
CClassLevelLicenseSniff | Custom sniff that requires all classes, interfaces, traits, and enums in a codebase to have the same license doc tag |
CDocCommentSniff | |
CEmptyTagSniff | Check for tags with nothing after them |
CFunctionAnnotationsSniff | |
CFunctionCommentSniff | |
CIllegalSingleLineCommentSniff | |
CLicenseCommentSniff | |
CMissingCoversSniff | Identify Test classes that do not have any @covers tags |
CPhpunitAnnotationsSniff | |
CPropertyDocumentationSniff | |
CRedundantVarNameSniff | Custom sniff that reports and repairs documentations of class properties that repeat the variable name, which is unnecessary |
CVariadicArgumentSniff | |
►NControlStructures | |
CMissingElseBetweenBracketsSniff | Sniff for missing control structures between closing and opening brackets |
►NExtraCharacters | Sniff to warn when keywords are used as functions, such as: Pass: clone $obj Fail: clone( $obj ) Pass: require 'path/to/file.php'; Fail: require( 'path/to/file' ); |
CParenthesesAroundKeywordSniff | |
►NFiles | |
CClassMatchesFilenameSniff | |
►NNamingConventions | Verify that global functions start with a valid prefix |
CLowerCamelFunctionsNameSniff | Make sure function names follow lower camel case |
CPrefixedGlobalFunctionsSniff | |
CValidGlobalNameSniff | |
►NPHPUnit | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version |
CAssertCountSniff | Replace assertEquals and assertSame where the actual value is count( anything ) with the more specific assertCount |
CAssertEmptySniff | Warn when using PHPUnit's looser assertEmpty() |
CAssertEqualsSniff | Discourages the use of PHPUnit's relaxed, not type-safe assertEquals() in favor of strict alternatives like assertSame(), assertNull(), and such |
CAssertionOrderSniff | Fix uses of assertEquals/assertNotEquals or assertSame/assertNotSame with the actual value before the expected Currently, only catches assertions where the actual value is a variable, or at least starts with a variable token, and the expected is a literal value or a variable in the form $expected*, or an array of such values (including nested arrays) |
CDeprecatedPHPUnitMethodsSniff | Forbids usage of PHPUnit methods deprecated/removed in PHPUnit8 @fixme Avoid duplication with other PHPUnit-related sniffs |
CMockBoilerplateSniff | Simplify set up of mocks in PHPUnit test cases: ->will( $this->returnValue( ... ) ) becomes ->willReturn( ... ) as well as other ->will() shortcuts, see PHPUnit docs table 8.1 ->with( $this->equalTo( ... ) ) becomes ->with( ... ), for any number of parameters provided, since equalTo() is the default constraint checked if a value is provided (as long as the equalTo() call only had a single parameter) ->exactly( 1 ) becomes ->once() ->exactly( 0 ) becomes ->never() |
CPHPUnitClassUsageSniff | Converts PHPUnit_Framework_TestCase to the new PHPUnit 6 namespaced PHPUnit\Framework\Testcase |
CPHPUnitTypeHintsSniff | Ensure that setUp() and tearDown() have a void return type hint, since they were added in PHPUnit 8 |
CSetMethodsSniff | Replace calls to MockBuilder::setMethods (deprecated in PHPUnit 8) with MockBuilder::onlyMethods |
CSpecificAssertionsSniff | Replace generic assertions about specific conditions |
►NTests | |
CExtensionInfoTest | @covers \MediaWiki\Sniffs\Utils\ExtensionInfo |
CMediaWikiStandardTest | |
►NUsage | Sniff to suppress the use of: Fail: return $a = 0; Pass: return $a == 0 |
CAssignmentInReturnSniff | |
CDbrQueryUsageSniff | |
CDeprecatedConstantUsageSniff | |
CDeprecatedGlobalVariablesSniff | |
CDirUsageSniff | |
CExtendClassUsageSniff | |
CFinalPrivateSniff | |
CForbiddenFunctionsSniff | Use e.g |
CInArrayUsageSniff | Custom sniff that finds unnecessary slow in_array() that can be replaced with array_key_exists() or isset() |
CIsNullSniff | Identify usage of is_null and replace it with a comparison against null |
CMagicConstantClosureSniff | |
CNestedFunctionsSniff | |
CNestedInlineTernarySniff | |
CNullableTypeSniff | Enforce use of ?MyClass $x instead of MyClass $x = null , which is (correctly) misinterpreted as optional by IDEs and static analysis tools |
CPlusStringConcatSniff | |
CReferenceThisSniff | Disallows usage of &$this, which results in warnings since PHP 7.1 |
CStaticClosureSniff | |
CSuperGlobalsUsageSniff | |
►NUtils | Copyright (C) 2017 Kunal Mehta legok.nosp@m.tm@m.nosp@m.ember.nosp@m..fsf.nosp@m..org |
CExtensionInfo | |
►NVariableAnalysis | Detect unused MediaWiki global variable |
CMisleadingGlobalNamesSniff | Detect variables named like $wg[A-Z]* that do not refer to globals |
CUnusedGlobalVariablesSniff | |
►NWhiteSpace | Check multiple consecutive newlines in a file |
CEmptyLinesBetweenUseSniff | Complain about empty lines between the different use statements at the top of a file |
CMultipleEmptyLinesSniff | |
COpeningKeywordParenthesisSniff | |
CSpaceAfterClosureSniff | |
CSpaceBeforeBracketSniff | Sniff to warn when there is a space between a variable expression and [ |
CSpaceBeforeClassBraceSniff | |
CSpaceBeforeSingleLineCommentSniff | |
CSpaceyParenthesisSniff | |
CUnaryMinusSpacingSniff | Sniff to warn when there is a space after a unary minus operator |
CWhiteSpaceBeforeFunctionSniff | Check for tabs or extra spaces between the keyword function and the function name |
►NSomeExample | |
CDemo | |
►NSomeNamespace | |
CFooBar | |
►NSomething | |
►NTest | |
CTest1 | |
CTest2 | |
CTest1 | |
►NTestSpace | |
CTest | |
►NUsingTrait | |
CDemo | |
CAbsoluteCoversTest | @covers \OtherClass |
CAbstractCoversTest | |
CArrayShapes | |
CAssertionsCountTest | |
CAssertionsOrderTest | |
CAssertionsTest | |
CBar | |
CClassCoversTest | @covers FooBar |
CCorrectTest | |
CEmptyLicenseClass | Some class without license @license |
CEmptySeeExampleTests | |
CExample | |
CExampleClass | |
CExamplesTest | A Test file @coverDefaultClass Test @small |
CFailedExamples | |
CFoo | |
CFOO | |
CFooBar | |
CFooBar2 | |
CFooFoo | |
CFooTest | Unit tests have different naming conventions |
CFoundTest | Test, if a global not set by config is reported |
CHookHandler | |
CLegacyCorrectTest | |
CLegacyMissingTest | |
CLegacyWrongTest | |
CMessageTest | |
CMethodCoversTest | |
CMisleadingGlobalNames | |
CMissingTest | |
CMockBoilerplateTest | |
CMyLicenseClass | @license myLicense |
CNoCommentMyLicenseClass | |
CNoMyLicenseClass | Some class without license |
CNonTestExamples | Not a Test file @coversDefaultClass Test |
CNotATest1 | |
CNotATest2 | |
CNotATestClassCase | Normal (non-unit-test) class |
CNotFoundTest | Test, if a global set by config is not reported @phpcs:set MediaWiki.Usage.ExtendClassUsage nonConfigGlobals[] $wgMyNotConfigGlobal |
CNotMyLicenseClass | @license myLicense2 |
COtherTest | |
CPassedExamples | |
CPerson | |
CPhanTests | |
CPlusStringConcatSniffTest | |
CRelativeCoversDefaultClassTest | @coversDefaultClass AnotherClass |
CRelativeCoversTest | @covers OtherClass |
CRequestTest | |
CSomethingTest | |
CSpecificAssertionsTest | |
CStillNotATest1 | |
CStillNotATest2 | |
CTesFailedExamples2 | Brace on the new line |
CTest1 | |
CTest2 | |
CTest3 | |
CTest4 | |
CTestAccessAnnotation | |
CTestClass | |
CTestClassTestCase | |
CTestExamples | |
CTestExamplesOneLine | @license GPL-2.0-or-later |
CTestFailedExamples | Class comment without indent |
CTestFailedExamples1 | Too many space before class brace |
CTestFullyTypedConstructor | |
CTestInterface | |
CTestPassedExamples | |
CTestReturnConstructor | |
CTestShouldFail | |
CTestSimpleConstructor | |
CTestThisIsNotOk | |
CTestThisIsOk | |
CThisInterfaceIsOK | |
CThisInterfaceShouldFail | |
CUnusedUseNoNamespaceTest | |
CUserTest | |
CWrongTest | |