hoaproject / Devtools

The Hoa\Devtools library.
https://hoa-project.net/
6 stars 6 forks source link

Add a fixer to remove constructor return tag #29

Closed Metalaka closed 8 years ago

Metalaka commented 8 years ago

Fix #12

Hywan commented 8 years ago

Why is it that complicated? Can't use something like (in pseudo-code):

if ($method is CONSTRUCT_NAME) {
    if ($docBlock = $method->getDocBlock()) {
        $docBlock->removeTag('return');
    }
}

I don't understand why you reach the T_FUNCTION token, manage several line blocks etc.

Metalaka commented 8 years ago

i refactored the code to be more readable, but I can't make it as simple as you write.

Hywan commented 8 years ago

Looks correct! Thanks :-).

Hywan commented 8 years ago

Tested on https://github.com/hoaproject/Acl/pull/18, it works great!