Skip to content
New issue

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

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

Already on GitHub? # to your account

[11.x] No need to redeclare variables #53887

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

lucasmichot
Copy link
Contributor

This PR refactors the ServeCommand class by eliminating redundant redeclarations of variables, such as repeated instantiations of Stringable. Instead, a single $stringable variable is reused throughout the method. This change simplifies the code, improves readability, and slightly optimizes performance by avoiding repeated object creation.

@taylorotwell taylorotwell merged commit 69284e3 into laravel:11.x Dec 13, 2024
40 checks passed
@lucasmichot lucasmichot deleted the 11x-serve-command branch December 13, 2024 15:41
crynobone added a commit that referenced this pull request Dec 17, 2024
taylorotwell pushed a commit that referenced this pull request Dec 17, 2024
joostdebruijn added a commit to joostdebruijn/framework that referenced this pull request Dec 18, 2024
@kerwin-wildsea
Copy link

I wanted to create a Pull Request which would add a test to cover the error occurred in the Serve command. In this case, when a line unrelated to the port was in the outputBuffer. But looking at the existing tests in: ServeCommandLogParserTest.php only the function static::getRequestPortFromLine($line) is covered. Not the behaviour around it.

I don't really see how to easily add a test for this behaviour.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants