Skip to content

Error on method extraction with whitespace#2793

Draft
bart-jaskulski wants to merge 1 commit intophpactor:masterfrom
bart-jaskulski:extract-method-if-statement
Draft

Error on method extraction with whitespace#2793
bart-jaskulski wants to merge 1 commit intophpactor:masterfrom
bart-jaskulski:extract-method-if-statement

Conversation

@bart-jaskulski
Copy link
Copy Markdown
Contributor

Signed-off-by: Bart Jaskulski bjaskulski@protonmail.com

Signed-off-by: Bart Jaskulski <bjaskulski@protonmail.com>
@bart-jaskulski
Copy link
Copy Markdown
Contributor Author

If there's a whitespace inside if braces included in selection, method extractions goes awry. Current output is:

<?php

class Foo {

    public function bar() {
        $foo = $bar = 1;
        if ( $this->newMethod($foo, $bar);) {
            return true;
        }

        return false;
    }
    private function newMethod($foo, int $bar)
    {
        $foo && $bar 
    }

}

@bart-jaskulski bart-jaskulski marked this pull request as draft November 26, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant