Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c4ec3c2

Browse files
Merge branch '4.3' into 4.4
* 4.3: [ProxyManager] fix generating proxies for root-namespaced classes [DI] skip looking for config class when the extension class is anonymous Fix typo [Dotenv] FIX missing getenv [HttpClient][Psr18Client] Remove Psr18ExceptionTrait
2 parents b0eb6f3 + dfa118f commit c4ec3c2

File tree

7 files changed

+33
-15
lines changed

7 files changed

+33
-15
lines changed

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function getProxyFactoryCode(Definition $definition, $id, $factoryCode =
8585
public function getProxyCode(Definition $definition): string
8686
{
8787
$code = $this->classGenerator->generate($this->generateProxyClass($definition));
88+
$code = preg_replace('/^(class [^ ]++ extends )([^\\\\])/', '$1\\\\$2', $code);
8889

8990
if (version_compare(self::getProxyManagerVersion(), '2.2', '<')) {
9091
$code = preg_replace(

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ class LazyServiceProjectServiceContainer extends Container
2121
}
2222
}
2323

24-
class stdClass_%s extends %SstdClass implements \ProxyManager\%s
24+
class stdClass_%s extends \stdClass implements \ProxyManager\%s
2525
{%a}%A

src/Symfony/Component/DependencyInjection/Extension/Extension.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ public function getAlias()
8080
public function getConfiguration(array $config, ContainerBuilder $container)
8181
{
8282
$class = \get_class($this);
83+
84+
if (false !== strpos($class, "\0")) {
85+
return null; // ignore anonymous classes
86+
}
87+
8388
$class = substr_replace($class, '\Configuration', strrpos($class, '\\'));
8489
$class = $container->getReflectionClass($class);
8590

src/Symfony/Component/Dotenv/Dotenv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ private function resolveVariables(string $value, array $loadedVars): string
463463
} elseif (isset($this->values[$name])) {
464464
$value = $this->values[$name];
465465
} else {
466-
$value = '';
466+
$value = (string) getenv($name);
467467
}
468468

469469
if ('' === $value && isset($matches['default_value']) && '' !== $matches['default_value']) {

src/Symfony/Component/Dotenv/Tests/DotenvTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,17 @@ public function testGetVariablesValueFromEnvFirst()
443443
}
444444
}
445445

446+
public function testGetVariablesValueFromGetenv()
447+
{
448+
putenv('Foo=Bar');
449+
450+
$dotenv = new Dotenv(true);
451+
$values = $dotenv->parse('Foo=${Foo}');
452+
$this->assertSame('Bar', $values['Foo']);
453+
454+
putenv('Foo');
455+
}
456+
446457
/**
447458
* @group legacy
448459
* @expectedDeprecation The default value of "$usePutenv" argument of "%s" will be changed from "true" to "false" in Symfony 5.0. You should define its value explicitly.

src/Symfony/Component/HttpClient/Psr18Client.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function createUri(string $uri = ''): UriInterface
190190
/**
191191
* @internal
192192
*/
193-
trait Psr18ExceptionTrait
193+
class Psr18NetworkException extends \RuntimeException implements NetworkExceptionInterface
194194
{
195195
private $request;
196196

@@ -206,18 +206,21 @@ public function getRequest(): RequestInterface
206206
}
207207
}
208208

209-
/**
210-
* @internal
211-
*/
212-
class Psr18NetworkException extends \RuntimeException implements NetworkExceptionInterface
213-
{
214-
use Psr18ExceptionTrait;
215-
}
216-
217209
/**
218210
* @internal
219211
*/
220212
class Psr18RequestException extends \InvalidArgumentException implements RequestExceptionInterface
221213
{
222-
use Psr18ExceptionTrait;
214+
private $request;
215+
216+
public function __construct(TransportExceptionInterface $e, RequestInterface $request)
217+
{
218+
parent::__construct($e->getMessage(), 0, $e);
219+
$this->request = $request;
220+
}
221+
222+
public function getRequest(): RequestInterface
223+
{
224+
return $this->request;
225+
}
223226
}

src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,11 @@ public function setOptions(array $options)
401401
* ini_set('session.save_path', '/tmp');
402402
*
403403
* or pass in a \SessionHandler instance which configures session.save_handler in the
404-
* constructor, for a template see NativeFileSessionHandler or use handlers in
405-
* composer package drak/native-session
404+
* constructor, for a template see NativeFileSessionHandler.
406405
*
407406
* @see https://php.net/session-set-save-handler
408407
* @see https://php.net/sessionhandlerinterface
409408
* @see https://php.net/sessionhandler
410-
* @see https://github.com/zikula/NativeSession
411409
*
412410
* @param AbstractProxy|\SessionHandlerInterface|null $saveHandler
413411
*

0 commit comments

Comments
 (0)