Code cleaning #379

Merged
merged 1 commit into from Jan 20, 2017

Projects

None yet

3 participants

@jaymoulin

No description provided.

@ravage84 ravage84 commented on the diff Jun 24, 2016
.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
@ravage84
ravage84 Jun 24, 2016 Member

Merged that separately, thanks.

@jaymoulin
jaymoulin Jun 24, 2016

IMHO, we should do something with .gitignore also to remove all IDE cases because they should be in the global .gitignore from contributors. But what about the setup folder?

@ravage84
ravage84 Jun 24, 2016 Member

While I agree that such folders should be listed in the global .gitignore file of contributors, the reality is, they aren't and in th end it's easier to have a few entry in each repo's .gitignore file.

By the way, I have no global .gitignore file myself. 😼

@ravage84 ravage84 commented on the diff Jun 24, 2016
src/main/php/PHPMD/Rule/CleanCode/ElseExpression.php
@@ -82,15 +83,15 @@ public function apply(AbstractNode $node)
}
}
- private function isElseScope($scope, $parent)
+ private function isElseScope($scope, ASTNode $parent)
@ravage84
ravage84 Jun 24, 2016 Member

Ths changes the interface, which could break BC (for extending third party classes).

@jaymoulin
jaymoulin Jun 24, 2016 edited

Third party classes cannot extends this method since it's private and the code in it requires $parent to be an ASTNode instance. Maybe the purpose of this method is to be protected?

@ravage84
ravage84 Jun 24, 2016 Member

True, didn't see it's a private.
Nonetheless, I let @manuelpichler have a look.

@ravage84 ravage84 commented on the diff Jun 24, 2016
src/main/php/PHPMD/Rule/CleanCode/StaticAccess.php
@@ -87,20 +87,20 @@ public function apply(AbstractNode $node)
}
}
- private function isStaticMethodCall($methodCall)
+ private function isStaticMethodCall(AbstractNode $methodCall)
@ravage84
ravage84 Jun 24, 2016 Member

Same as above.

@jaymoulin
jaymoulin Jun 24, 2016

same as above ;)

@ravage84 ravage84 commented on an outdated diff Jun 24, 2016
src/main/php/PHPMD/Rule/Design/TooManyMethods.php
@@ -77,6 +77,7 @@ public function apply(AbstractNode $node)
if ($node->getMetric('nom') <= $threshold) {
return;
}
+ /** @var $node AbstractTypeNode */
@ravage84
ravage84 Jun 24, 2016 Member

Not sure, if I like to clutter the code will all these annotations...

@ravage84 ravage84 commented on the diff Jun 24, 2016
src/main/php/PHPMD/RuleSetFactory.php
*
- * @return array
+ * @return array|null
@ravage84
ravage84 Jun 24, 2016 Member

Can you please PR the changes to getIgnorePattern() without the @var annotation separately?

@ravage84
Member

Thanks for the contributions.

To make merging easier in the future, please open separate PRs.
Fo example all @var annotation changes in one PR.
So, if we reject this one for example, the other PRs can be merged without adjustment.

@ravage84 ravage84 added this to the 2.4.4 milestone Jun 24, 2016
@jaymoulin

Thanks for your return. I'll manage to handle that

@jaymoulin jaymoulin Code cleaning without annotations
902da6c
@manuelpichler manuelpichler merged commit bb57b00 into phpmd:master Jan 20, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jaymoulin jaymoulin deleted the jaymoulin:code-clean branch Jan 20, 2017
@ravage84 ravage84 modified the milestone: 2.5.1, 2.6.0 Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment