Skip to content

Commit 5baa123

Browse files
Merge branch '5.1' into 5.x
* 5.1: [DI] fix dumping env vars [HttpClient] skip executing the multi handle when it's freed already [HttpClient] fix using freed curl resource at destruct time [HttpClient] shutdown verbose output from curl at destruction fix warning for preloading TranslatorTrait class [Typography] Remove unneeded description comments
2 parents f52f090 + 63288a6 commit 5baa123

14 files changed

+8
-26
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ private function addDefaultParametersMethod(): string
14791479
$export = $this->exportParameters([$value]);
14801480
$export = explode('0 => ', substr(rtrim($export, " ]\n"), 2, -1), 2);
14811481

1482-
if (preg_match("/\\\$this->(?:getEnv\('(?:\w++:)*+\w++'\)|targetDir\.'')/", $export[1])) {
1482+
if (preg_match("/\\\$this->(?:getEnv\('(?:[-.\w]*+:)*+\w++'\)|targetDir\.'')/", $export[1])) {
14831483
$dynamicPhp[$key] = sprintf('%scase %s: $value = %s; break;', $export[0], $this->export($key), $export[1]);
14841484
} else {
14851485
$php[] = sprintf('%s%s => %s,', $export[0], $this->export($key), $export[1]);
@@ -1885,7 +1885,7 @@ private function dumpParameter(string $name): string
18851885
return $dumpedValue;
18861886
}
18871887

1888-
if (!preg_match("/\\\$this->(?:getEnv\('(?:\w++:)*+\w++'\)|targetDir\.'')/", $dumpedValue)) {
1888+
if (!preg_match("/\\\$this->(?:getEnv\('(?:[-.\w]*+:)*+\w++'\)|targetDir\.'')/", $dumpedValue)) {
18891889
return sprintf('$this->parameters[%s]', $this->doExport($name));
18901890
}
18911891
}

src/Symfony/Component/HttpClient/CurlHttpClient.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,10 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
331331
throw new \TypeError(sprintf('"%s()" expects parameter 1 to be an iterable of CurlResponse objects, "%s" given.', __METHOD__, get_debug_type($responses)));
332332
}
333333

334-
$active = 0;
335-
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
334+
if (\is_resource($this->multi->handle) || $this->multi->handle instanceof \CurlMultiHandle) {
335+
$active = 0;
336+
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
337+
}
336338

337339
return new ResponseStream(CurlResponse::stream($responses, $timeout));
338340
}

src/Symfony/Component/HttpClient/Response/CurlResponse.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ public function getContent(bool $throw = true): string
247247

248248
public function __destruct()
249249
{
250+
curl_setopt($this->handle, \CURLOPT_VERBOSE, false);
251+
250252
if (null === $this->timeout) {
251253
return; // Unused pushed response
252254
}

src/Symfony/Component/Serializer/Encoder/DecoderInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
1515

1616
/**
17-
* Defines the interface of decoders.
18-
*
1917
* @author Jordi Boggiano <[email protected]>
2018
*/
2119
interface DecoderInterface

src/Symfony/Component/Serializer/Encoder/EncoderInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
1515

1616
/**
17-
* Defines the interface of encoders.
18-
*
1917
* @author Jordi Boggiano <[email protected]>
2018
*/
2119
interface EncoderInterface

src/Symfony/Component/Serializer/Normalizer/DenormalizerAwareInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace Symfony\Component\Serializer\Normalizer;
1313

1414
/**
15-
* Class accepting a denormalizer.
16-
*
1715
* @author Joel Wurtz <[email protected]>
1816
*/
1917
interface DenormalizerAwareInterface

src/Symfony/Component/Serializer/Normalizer/DenormalizerAwareTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace Symfony\Component\Serializer\Normalizer;
1313

1414
/**
15-
* DenormalizerAware trait.
16-
*
1715
* @author Joel Wurtz <[email protected]>
1816
*/
1917
trait DenormalizerAwareTrait

src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
2121

2222
/**
23-
* Defines the interface of denormalizers.
24-
*
2523
* @author Jordi Boggiano <[email protected]>
2624
*/
2725
interface DenormalizerInterface

src/Symfony/Component/Serializer/Normalizer/NormalizerAwareInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace Symfony\Component\Serializer\Normalizer;
1313

1414
/**
15-
* Class accepting a normalizer.
16-
*
1715
* @author Joel Wurtz <[email protected]>
1816
*/
1917
interface NormalizerAwareInterface

src/Symfony/Component/Serializer/Normalizer/NormalizerAwareTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace Symfony\Component\Serializer\Normalizer;
1313

1414
/**
15-
* NormalizerAware trait.
16-
*
1715
* @author Joel Wurtz <[email protected]>
1816
*/
1917
trait NormalizerAwareTrait

0 commit comments

Comments
 (0)