Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve comment detection before "return" statement #68

Open
aik099 opened this issue Mar 1, 2015 · 0 comments
Open

Improve comment detection before "return" statement #68

aik099 opened this issue Mar 1, 2015 · 0 comments

Comments

@aik099
Copy link
Owner

aik099 commented Mar 1, 2015

Case 1: block comments

else {
    /*if ( is_null($input_type)
        || ($input_type == self::TEXT_INPUT)
        || ($input_type == self::PASSWORD_INPUT)
    ) {*/
    return TextInput::fromNodeElement($node_element);
}

Case 2: multiple single line comments (just use https://github.com/aik099/CodingStandard/blob/master/CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php#L408)

else {
    // line 1
    // line 2
    return TextInput::fromNodeElement($node_element);
}

Case 3: comment belonging to other code (need to ignore such comment and don't combine it with return)

$var_name = new ClassName();
/** @var ClassName $var_name */

return $var_name;
@aik099 aik099 changed the title Allow block comments before "return" Improve comment detection before "return" statement Mar 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant