diff --git a/.gitattributes b/.gitattributes index a52304348..610302729 100644 --- a/.gitattributes +++ b/.gitattributes @@ -28,3 +28,5 @@ build.xml export-ignore phpunit.xml.dist export-ignore pdepend.xml.dist export-ignore composer.lock export-ignore +.editorconfig export-ignore +appveyor.yml export-ignore diff --git a/src/main/php/PHPMD/AbstractNode.php b/src/main/php/PHPMD/AbstractNode.php index b2c713937..46219d6c2 100644 --- a/src/main/php/PHPMD/AbstractNode.php +++ b/src/main/php/PHPMD/AbstractNode.php @@ -100,7 +100,7 @@ public function __call($name, array $args) * Returns the parent of this node or null when no parent node * exists. * - * @return \PHPMD\AbstractNode + * @return ASTNode */ public function getParent() { diff --git a/src/main/php/PHPMD/Report.php b/src/main/php/PHPMD/Report.php index 8f7dd7b4e..d7a47bf24 100644 --- a/src/main/php/PHPMD/Report.php +++ b/src/main/php/PHPMD/Report.php @@ -54,7 +54,7 @@ class Report /** * List of rule violations detected in the analyzed source code. * - * @var \PHPMD\RuleViolation[] + * @var array */ private $ruleViolations = array(); @@ -115,7 +115,7 @@ public function isEmpty() /** * Returns an iterator with all occurred rule violations. * - * @return \Iterator + * @return \PHPMD\RuleViolation[] */ public function getRuleViolations() { diff --git a/src/main/php/PHPMD/Rule/CleanCode/ElseExpression.php b/src/main/php/PHPMD/Rule/CleanCode/ElseExpression.php index a69eb65ce..c50147cee 100644 --- a/src/main/php/PHPMD/Rule/CleanCode/ElseExpression.php +++ b/src/main/php/PHPMD/Rule/CleanCode/ElseExpression.php @@ -43,6 +43,7 @@ use PHPMD\AbstractNode; use PHPMD\AbstractRule; +use PHPMD\Node\ASTNode; use PHPMD\Rule\FunctionAware; use PHPMD\Rule\MethodAware; @@ -82,7 +83,7 @@ public function apply(AbstractNode $node) } } - private function isElseScope($scope, $parent) + private function isElseScope($scope, ASTNode $parent) { return ( count($parent->getChildren()) === 3 && @@ -90,7 +91,7 @@ private function isElseScope($scope, $parent) ); } - private function isIfOrElseIfStatement($parent) + private function isIfOrElseIfStatement(ASTNode $parent) { return ($parent->getName() === "if" || $parent->getName() === "elseif"); } diff --git a/src/main/php/PHPMD/Rule/CleanCode/StaticAccess.php b/src/main/php/PHPMD/Rule/CleanCode/StaticAccess.php index 5b39ba7c0..1751e742a 100644 --- a/src/main/php/PHPMD/Rule/CleanCode/StaticAccess.php +++ b/src/main/php/PHPMD/Rule/CleanCode/StaticAccess.php @@ -87,7 +87,7 @@ public function apply(AbstractNode $node) } } - private function isStaticMethodCall($methodCall) + private function isStaticMethodCall(AbstractNode $methodCall) { return $methodCall->getChild(0)->getNode() instanceof ASTClassOrInterfaceReference && $methodCall->getChild(1)->getNode() instanceof ASTMethodPostfix && @@ -95,12 +95,12 @@ private function isStaticMethodCall($methodCall) !$this->isCallingSelf($methodCall); } - private function isCallingParent($methodCall) + private function isCallingParent(AbstractNode $methodCall) { return $methodCall->getChild(0)->getNode() instanceof ASTParentReference; } - private function isCallingSelf($methodCall) + private function isCallingSelf(AbstractNode $methodCall) { return $methodCall->getChild(0)->getNode() instanceof ASTSelfReference; } diff --git a/src/main/php/PHPMD/RuleSetFactory.php b/src/main/php/PHPMD/RuleSetFactory.php index 2c1fc0e1c..05ca665e8 100644 --- a/src/main/php/PHPMD/RuleSetFactory.php +++ b/src/main/php/PHPMD/RuleSetFactory.php @@ -534,9 +534,9 @@ private function getPropertyValue(\SimpleXMLElement $propertyNode) * * http://pmd.sourceforge.net/pmd-5.0.4/howtomakearuleset.html#Excluding_files_from_a_ruleset * - * @param $fileName The filename of a rule-set definition. + * @param string $fileName The filename of a rule-set definition. * - * @return array + * @return array|null * @throws \RuntimeException */ public function getIgnorePattern($fileName) @@ -564,5 +564,6 @@ public function getIgnorePattern($fileName) return $excludes; } + return null; } }