Skip to content

Conversation

OskarStark
Copy link
Contributor

No description provided.

@OskarStark OskarStark self-assigned this Dec 6, 2024
@carsonbot carsonbot added this to the 6.4 milestone Dec 6, 2024
Co-authored-by: Wouter de Jong <[email protected]>
@javiereguiluz
Copy link
Member

I'm not against this PR ... but generally, I think that removing one-time-variables like this is actually an anti-pattern.

Let me explain:

You can read the following code and 100% understand it without "compiling it in your head":

$responseData = json_decode($responseJson, true, 512, JSON_THROW_ON_ERROR);

return $responseData;

You can't do the same with this other example:

return json_decode($responseJson, true, 512, JSON_THROW_ON_ERROR);

You must "compile the example in your head" to understand what you are truly returning.

Also, removing these one-time-variables doesn't improve performance, because PHP compiler already does this and other optimizations for you.

@OskarStark
Copy link
Contributor Author

Fine for me 👍

@OskarStark OskarStark closed this Dec 7, 2024
@OskarStark OskarStark deleted the feature/remove-otv branch December 7, 2024 10:26
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.

4 participants