TASK: Configure phpmd

* Make phpmd pass.
* Comment supressions with a reason.
This commit is contained in:
Daniel Siepmann 2017-04-11 08:39:32 +02:00
parent e48cbe712e
commit 89af4a2e37
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
7 changed files with 32 additions and 8 deletions

View file

@ -10,10 +10,18 @@
My custom rule set that checks my code... My custom rule set that checks my code...
</description> </description>
<rule ref="rulesets/cleancode.xml" /> <rule ref="rulesets/cleancode.xml">
<rule ref="rulesets/codesize.xml" /> <exclude name="StaticAccess" />
<rule ref="rulesets/controversial.xml" /> </rule>
<rule ref="rulesets/design.xml" /> <rule ref="rulesets/codesize.xml">
<rule ref="rulesets/naming.xml" /> </rule>
<rule ref="rulesets/unusedcode.xml" /> <rule ref="rulesets/controversial.xml">
<exclude name="CamelCaseClassName" />
</rule>
<rule ref="rulesets/design.xml">
</rule>
<rule ref="rulesets/naming.xml">
</rule>
<rule ref="rulesets/unusedcode.xml">
</rule>
</ruleset> </ruleset>

View file

@ -65,6 +65,8 @@ class PHP_CodeSniffer_Tokenizers_TYPOSCRIPT
* @param string $eolChar The EOL character to use for splitting strings. * @param string $eolChar The EOL character to use for splitting strings.
* *
* @return void * @return void
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter) We need to match the signature.
*/ */
public function processAdditional(&$tokens, $eolChar) public function processAdditional(&$tokens, $eolChar)
{ {

View file

@ -82,6 +82,8 @@ abstract class AbstractClassnameChecker implements PhpCsSniff
* the token was found. * the token was found.
* *
* @return void * @return void
*
* @SuppressWarnings(PHPMD.ElseExpression) This is for performance reason.
*/ */
public function process(PhpCsFile $phpcsFile, $stackPtr) public function process(PhpCsFile $phpcsFile, $stackPtr)
{ {
@ -217,6 +219,8 @@ abstract class AbstractClassnameChecker implements PhpCsSniff
* @param int $classnamePosition * @param int $classnamePosition
* @param string $classname * @param string $classname
* @param bool $forceEmptyPrefix Defines whether '\\' prefix should be checked or always be left out. * @param bool $forceEmptyPrefix Defines whether '\\' prefix should be checked or always be left out.
*
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
*/ */
protected function replaceLegacyClassname( protected function replaceLegacyClassname(
PhpCsFile $phpcsFile, PhpCsFile $phpcsFile,
@ -243,6 +247,8 @@ abstract class AbstractClassnameChecker implements PhpCsSniff
* @param string $originalClassname * @param string $originalClassname
* @param PhpCsFile $phpcsFile * @param PhpCsFile $phpcsFile
* @return string * @return string
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter) We need to match the signature.
*/ */
protected function getTokenForReplacement($newClassname, $originalClassname, PhpCsFile $phpcsFile) protected function getTokenForReplacement($newClassname, $originalClassname, PhpCsFile $phpcsFile)
{ {

View file

@ -48,6 +48,9 @@ final class Mapping
private function __clone() private function __clone()
{ {
} }
/**
* @SuppressWarnings(PHPMD.UnusedPrivateMethod) We just want to implement singleton pattern.
*/
private function __wakeup() private function __wakeup()
{ {
} }

View file

@ -95,6 +95,8 @@ class Typo3Update_Sniffs_LegacyClassnames_MissingNamespaceSniff extends Abstract
* @param int $classnamePosition * @param int $classnamePosition
* @param string $classname * @param string $classname
* @param bool $forceEmptyPrefix Defines whether '\\' prefix should be checked or always be left out. * @param bool $forceEmptyPrefix Defines whether '\\' prefix should be checked or always be left out.
*
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
*/ */
protected function replaceLegacyClassname( protected function replaceLegacyClassname(
PhpCsFile $phpcsFile, PhpCsFile $phpcsFile,

View file

@ -46,6 +46,8 @@ class Typo3Update_Sniffs_LegacyClassnames_UseSniff extends AbstractClassnameChec
* @param int $classnamePosition * @param int $classnamePosition
* @param string $classname * @param string $classname
* @param bool $forceEmptyPrefix Defines whether '\\' prefix should be checked or always be left out. * @param bool $forceEmptyPrefix Defines whether '\\' prefix should be checked or always be left out.
*
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
*/ */
protected function replaceLegacyClassname( protected function replaceLegacyClassname(
PhpCsFile $phpcsFile, PhpCsFile $phpcsFile,

View file

@ -29,8 +29,9 @@ use Typo3Update\Sniffs\Options;
/** /**
* Contains common functionality for removed code like constants or functions. * Contains common functionality for removed code like constants or functions.
* *
* Removed parts are configured using YAML-Files, for examples see src/Standards/Typo3Update/Configuration/Removed/Constants/7.0.yaml * Removed parts are configured using YAML-Files, for examples see
* Also check out the configuration options in Readme.rst. * src/Standards/Typo3Update/Configuration/Removed/Constants/7.0.yaml Also
* check out the configuration options in Readme.rst.
*/ */
abstract class AbstractGenericUsage implements PhpCsSniff abstract class AbstractGenericUsage implements PhpCsSniff
{ {