-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Fixed broken master build #36485
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
Conversation
986b2aa
to
8a0dae4
Compare
Hmm, seems like this very minor change introduces a new failing tests (on Travis only, but this time in all jobs, so not related to PHP return typing):
Looking at the test, I can't see |
I'm for using solution 2. |
I suspect the other failure to be related to the just released PHP 7.3.17, and to php/php-src@b510250 specifically. |
Alright, so unrelated to this PR. Travis confirms this fixes the PHP 7.4 build for Security HTTP, so ready to merge imho :) |
Thank you @wouterj. |
The build failures are caused by these lines (line 100 specically):
symfony/src/Symfony/Component/Security/Http/Firewall/ContextListener.php
Lines 97 to 108 in 2460ca5
Since #34363,
$request->cookies->get()
is typehinted asstring|null
. On Travis with PHP=7.4, this doc typehint is transformed into PHP return type:get(): ?string
.On tests, the session cookie is set to
true
. See #36118 for some background on why this is necessary.There are a couple possible solutions:
InputBag::get()
PHPdoc to use@return scalar|null
$request->cookie->all()[$session->getName()]
inContextListener
MockArraySessionStorage
.I've implemented solution (1). The method is actually using
is_scalar()
to check if a deprecation notice should be triggered, so it is expected to return a scalar in Symfony 6.I've had to update the
DebugClassLoader
to not convert this toget(): ?scalar
, as that doesn't exists in PHP. I'm not sure if my changes are correct (but they work).