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

[8.x] Remove an useless check in Console Application class #40133

Closed
wants to merge 1 commit into from

Conversation

seriquynh
Copy link
Contributor

The local variable $input inside the parseCommand method of Console Application class is always an instance of either StringInput or ArrayInput. It's never null (false), so "$input ?? null" is useless. I just remove that check.

@GrahamCampbell
Copy link
Member

Incorrect, this is not useless. It only gets set if you enter the else branch of the if.

@seriquynh seriquynh deleted the remove-useless-check branch December 23, 2021 00:53
@seriquynh
Copy link
Contributor Author

@GrahamCampbell Could you show me the use-case in which the $input of this method is not set, please? I see it's always set, never null.

@seriquynh
Copy link
Contributor Author

seriquynh commented Dec 23, 2021

Either the block of if is executed, or otherwise the block of else is executed. When both of them aren't executed.

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.

3 participants