Skip to content

[HttpKernel] fix docblock #40611

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

Merged
merged 1 commit into from
Mar 28, 2021
Merged

[HttpKernel] fix docblock #40611

merged 1 commit into from
Mar 28, 2021

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Mar 28, 2021

Q A
Branch? 5.2
Bug fix? no
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

@xabbuh xabbuh added this to the 5.2 milestone Mar 28, 2021
@xabbuh xabbuh force-pushed the pr-40535 branch 2 times, most recently from 5220f51 to da181fc Compare March 28, 2021 13:45
@xabbuh xabbuh changed the title [HttpKernel] debug test failures [HttpKernel] fix docblock Mar 28, 2021
@xabbuh
Copy link
Member Author

xabbuh commented Mar 28, 2021

This fixes tests where the code is patched to have real return type declarations.

@Nyholm
Copy link
Member

Nyholm commented Mar 28, 2021

I think you are referring to this PR #40535

But I dont see how your fix solves the build. Could you please elaborate?

@@ -219,7 +219,7 @@ public function getEnv()
/**
* Returns true if the debug is enabled.
*
* @return bool true if debug is enabled, false otherwise
* @return bool|string true if debug is enabled, false otherwise or a string if no kernel was set
Copy link
Member

Choose a reason for hiding this comment

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

Is this better?

Suggested change
* @return bool|string true if debug is enabled, false otherwise or a string if no kernel was set
* @return bool|'n/a' true if debug is enabled, false otherwise or a string if no kernel was set

Copy link
Member Author

Choose a reason for hiding this comment

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

n/a is not a valid type I think

Copy link
Member

Choose a reason for hiding this comment

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

n/a is not a valid type I think

'n/a' is a literal type. PHPStan and Psalm support literal types, but I'm not aware that we've ever used them in the Symfony codebase.

@xabbuh
Copy link
Member Author

xabbuh commented Mar 28, 2021

@Nyholm In the pipeline we have a job that patches our code to add real return type declarations. Which means here that when n/a is cast to a boolean isDebug() always returns true.

@Nyholm
Copy link
Member

Nyholm commented Mar 28, 2021

Oh. That is cool. I didn't know that.

@Nyholm
Copy link
Member

Nyholm commented Mar 28, 2021

Thank you

@Nyholm Nyholm merged commit 5545755 into symfony:5.2 Mar 28, 2021
@xabbuh xabbuh deleted the pr-40535 branch March 28, 2021 18:57
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.

6 participants