rectorphp / rector-book-feedback

[BOOK] Repository for feedback from readers of Rector book, to improve it continuously
https://leanpub.com/rector-the-power-of-automated-refactoring
15 stars 2 forks source link

extra namespace item #16

Closed oceanicpanda closed 3 years ago

oceanicpanda commented 3 years ago

Code Improvement

I think code on page 86 could be improved:

Why?

Because in the example test.php given the namespace is shown as "namespace FindingNodeCandidates" but the dumped node has 2 elements in the "parts" array.

["parts"] => array(2) { [0] => "TestDrivenRuleDevelopment" [1] => "FindingNodeCandidates" }

I propose this change

-before
["parts"] => array(2) {
[0] => "TestDrivenRuleDevelopment"
[1] => "FindingNodeCandidates"
}
+after
["parts"] => array(2) {
[0] => "FindingNodeCandidates"
}

Thanks!

TomasVotruba commented 3 years ago

Thank you! It's fixed now :+1:

matthiasnoback commented 3 years ago

This was fixed, but the code generation tool added it back the next time we ran it ;) I've now made a permanent fix for this.