Skip to content

Commit da20df1

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: [Serializer] Remove redundant @internal tags from traceable classes Fix conversion of partitioned cookies in the PSR-7 bridge [Validator] added Polish translation for units 116-119 Revert stateless check [Console] Fix side-effects from running bash completions skip transient Redis integration tests on AppVeyor
2 parents bd244cc + 2738461 commit da20df1

File tree

9 files changed

+15
-88
lines changed

9 files changed

+15
-88
lines changed

src/Symfony/Bridge/PsrHttpMessage/Factory/HttpFoundationFactory.php

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -129,89 +129,12 @@ public function createResponse(ResponseInterface $psrResponse, bool $streamed =
129129
$response->setProtocolVersion($psrResponse->getProtocolVersion());
130130

131131
foreach ($cookies as $cookie) {
132-
$response->headers->setCookie($this->createCookie($cookie));
132+
$response->headers->setCookie(Cookie::fromString($cookie));
133133
}
134134

135135
return $response;
136136
}
137137

138-
/**
139-
* Creates a Cookie instance from a cookie string.
140-
*
141-
* Some snippets have been taken from the Guzzle project: https://github.com/guzzle/guzzle/blob/5.3/src/Cookie/SetCookie.php#L34
142-
*
143-
* @throws \InvalidArgumentException
144-
*/
145-
private function createCookie(string $cookie): Cookie
146-
{
147-
foreach (explode(';', $cookie) as $part) {
148-
$part = trim($part);
149-
150-
$data = explode('=', $part, 2);
151-
$name = $data[0];
152-
$value = isset($data[1]) ? trim($data[1], " \n\r\t\0\x0B\"") : null;
153-
154-
if (!isset($cookieName)) {
155-
$cookieName = $name;
156-
$cookieValue = $value;
157-
158-
continue;
159-
}
160-
161-
if ('expires' === strtolower($name) && null !== $value) {
162-
$cookieExpire = new \DateTime($value);
163-
164-
continue;
165-
}
166-
167-
if ('path' === strtolower($name) && null !== $value) {
168-
$cookiePath = $value;
169-
170-
continue;
171-
}
172-
173-
if ('domain' === strtolower($name) && null !== $value) {
174-
$cookieDomain = $value;
175-
176-
continue;
177-
}
178-
179-
if ('secure' === strtolower($name)) {
180-
$cookieSecure = true;
181-
182-
continue;
183-
}
184-
185-
if ('httponly' === strtolower($name)) {
186-
$cookieHttpOnly = true;
187-
188-
continue;
189-
}
190-
191-
if ('samesite' === strtolower($name) && null !== $value) {
192-
$samesite = $value;
193-
194-
continue;
195-
}
196-
}
197-
198-
if (!isset($cookieName)) {
199-
throw new \InvalidArgumentException('The value of the Set-Cookie header is malformed.');
200-
}
201-
202-
return new Cookie(
203-
$cookieName,
204-
$cookieValue,
205-
$cookieExpire ?? 0,
206-
$cookiePath ?? '/',
207-
$cookieDomain ?? null,
208-
isset($cookieSecure),
209-
isset($cookieHttpOnly),
210-
true,
211-
$samesite ?? null
212-
);
213-
}
214-
215138
private function createStreamedResponseCallback(StreamInterface $body): callable
216139
{
217140
return function () use ($body) {

src/Symfony/Component/Console/Resources/completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ _sf_{{ COMMAND_NAME }}() {
1717
done
1818

1919
# Use newline as only separator to allow space in completion values
20-
IFS=$'\n'
20+
local IFS=$'\n'
2121
local sf_cmd="${COMP_WORDS[0]}"
2222

2323
# for an alias, get the real script behind it

src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisExtIntegrationTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@ public function testGetNonBlocking()
372372
}
373373
}
374374

375+
/**
376+
* @group transient-on-windows
377+
*/
375378
public function testGetAfterReject()
376379
{
377380
$redis = $this->createRedisClient();

src/Symfony/Component/Security/Http/Firewall/ContextListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public function authenticate(RequestEvent $event): void
8585
}
8686

8787
$request = $event->getRequest();
88-
$session = !$request->attributes->getBoolean('_stateless') && $request->hasPreviousSession() ? $request->getSession() : null;
88+
$session = $request->hasPreviousSession() ? $request->getSession() : null;
89+
8990

9091
$request->attributes->set('_security_firewall_run', $this->sessionKey);
9192

src/Symfony/Component/Serializer/DataCollector/SerializerDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
2323
*
24-
* @internal
24+
* @final
2525
*/
2626
class SerializerDataCollector extends DataCollector implements LateDataCollectorInterface
2727
{

src/Symfony/Component/Serializer/Debug/TraceableEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
2525
*
26-
* @internal
26+
* @final
2727
*/
2828
class TraceableEncoder implements EncoderInterface, DecoderInterface, SerializerAwareInterface
2929
{

src/Symfony/Component/Serializer/Debug/TraceableNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
2626
*
27-
* @internal
27+
* @final
2828
*/
2929
class TraceableNormalizer implements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface, NormalizerAwareInterface, DenormalizerAwareInterface
3030
{

src/Symfony/Component/Serializer/Debug/TraceableSerializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
2525
*
26-
* @internal
26+
* @final
2727
*/
2828
class TraceableSerializer implements SerializerInterface, NormalizerInterface, DenormalizerInterface, EncoderInterface, DecoderInterface
2929
{

src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,19 +452,19 @@
452452
</trans-unit>
453453
<trans-unit id="116">
454454
<source>This value does not represent a valid week in the ISO 8601 format.</source>
455-
<target state="needs-translation">This value does not represent a valid week in the ISO 8601 format.</target>
455+
<target>Podana wartość nie jest poprawnym oznaczeniem tygodnia w formacie ISO 8601.</target>
456456
</trans-unit>
457457
<trans-unit id="117">
458458
<source>This value is not a valid week.</source>
459-
<target state="needs-translation">This value is not a valid week.</target>
459+
<target>Podana wartość nie jest poprawnym oznaczeniem tygodnia.</target>
460460
</trans-unit>
461461
<trans-unit id="118">
462462
<source>This value should not be before week "{{ min }}".</source>
463-
<target state="needs-translation">This value should not be before week "{{ min }}".</target>
463+
<target>Podana wartość nie powinna być przed tygodniem "{{ min }}".</target>
464464
</trans-unit>
465465
<trans-unit id="119">
466466
<source>This value should not be after week "{{ max }}".</source>
467-
<target state="needs-translation">This value should not be after week "{{ max }}".</target>
467+
<target>Podana wartość nie powinna być po tygodniu "{{ max }}".</target>
468468
</trans-unit>
469469
</body>
470470
</file>

0 commit comments

Comments
 (0)