Skip to content

Commit 63288a6

Browse files
Merge branch '4.4' into 5.1
* 4.4: [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 5b9ccde + d79912d commit 63288a6

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
@@ -326,8 +326,10 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
326326
throw new \TypeError(sprintf('"%s()" expects parameter 1 to be an iterable of CurlResponse objects, "%s" given.', __METHOD__, get_debug_type($responses)));
327327
}
328328

329-
$active = 0;
330-
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
329+
if (\is_resource($this->multi->handle) || $this->multi->handle instanceof \CurlMultiHandle) {
330+
$active = 0;
331+
while (\CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
332+
}
331333

332334
return new ResponseStream(CurlResponse::stream($responses, $timeout));
333335
}

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

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

226226
public function __destruct()
227227
{
228+
curl_setopt($this->handle, \CURLOPT_VERBOSE, false);
229+
228230
if (null === $this->timeout) {
229231
return; // Unused pushed response
230232
}

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)