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

Add Sniff to report useless variables #72

Merged
merged 1 commit into from
Aug 27, 2018
Merged

Conversation

carusogabriel
Copy link
Contributor

@carusogabriel carusogabriel commented Aug 24, 2018

A declared variable that is return right after it, should be inline:

function foo() {
-    $foo = 'bar';
-    
-    return $foo;
+    return 'bar';
}

@carusogabriel carusogabriel added this to the 5.0.0 milestone Aug 24, 2018
@carusogabriel carusogabriel self-assigned this Aug 24, 2018
@carusogabriel carusogabriel changed the title [WIP] Sniff to report useless variables Add Sniff to report useless variables Aug 25, 2018
@carusogabriel carusogabriel removed the WIP label Aug 25, 2018
alcaeus
alcaeus previously approved these changes Aug 25, 2018
Declared variable that are return right after it, should be inline
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@Ocramius Ocramius assigned Ocramius and unassigned carusogabriel Aug 27, 2018
@Ocramius Ocramius merged commit 93408b2 into master Aug 27, 2018
@Ocramius Ocramius deleted the useless-variables branch August 27, 2018 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants