Permalink
Browse files

Code cleaning without annotations

  • Loading branch information...
1 parent 0995c85 commit 902da6c7ee9c2f184033e847a74418c9ff5c7400 @jaymoulin jaymoulin committed Jun 24, 2016
View
@@ -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
@@ -100,7 +100,7 @@ public function __call($name, array $args)
* Returns the parent of this node or <b>null</b> when no parent node
* exists.
*
- * @return \PHPMD\AbstractNode
+ * @return ASTNode
*/
public function getParent()
{
@@ -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()
{
@@ -43,6 +43,7 @@
use PHPMD\AbstractNode;
use PHPMD\AbstractRule;
+use PHPMD\Node\ASTNode;
use PHPMD\Rule\FunctionAware;
use PHPMD\Rule\MethodAware;
@@ -82,15 +83,15 @@ public function apply(AbstractNode $node)
}
}
- private function isElseScope($scope, $parent)
+ private function isElseScope($scope, ASTNode $parent)
{
return (
count($parent->getChildren()) === 3 &&
$scope->getNode() === $parent->getChild(2)->getNode()
);
}
- private function isIfOrElseIfStatement($parent)
+ private function isIfOrElseIfStatement(ASTNode $parent)
{
return ($parent->getName() === "if" || $parent->getName() === "elseif");
}
@@ -87,20 +87,20 @@ 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 &&
!$this->isCallingParent($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;
}
@@ -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;
}
}

0 comments on commit 902da6c

Please sign in to comment.