Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 582eb5c

Browse filesBrowse files
Merge branch '4.4' into 5.0
* 4.4: [DependencyInjection] Fix binding tagged services to containers [ProxyManager] fix generating proxies for root-namespaced classes [DI] skip looking for config class when the extension class is anonymous Fix typo Docs - Update debug section of UPGRADE guides for 4.4 and 5.0 versions. [Dotenv] FIX missing getenv [HttpFoundation] fix pdo session handler for sqlsrv [HttpClient][Psr18Client] Remove Psr18ExceptionTrait [HttpKernel] ignore failuresgenerated by opcache.restrict_api
2 parents 94ab844 + 1dc833d commit 582eb5c
Copy full SHA for 582eb5c

File tree

14 files changed

+53
-24
lines changed
Filter options

14 files changed

+53
-24
lines changed

‎UPGRADE-4.4.md

Copy file name to clipboardExpand all lines: UPGRADE-4.4.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Debug
1919
-----
2020

2121
* Deprecated the component in favor of the `ErrorHandler` component
22+
* Replace uses of `Symfony\Component\Debug\Debug` by `Symfony\Component\ErrorHandler\Debug`
2223

2324
Config
2425
------

‎UPGRADE-5.0.md

Copy file name to clipboardExpand all lines: UPGRADE-5.0.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Debug
6060
-----
6161

6262
* Removed the component in favor of the `ErrorHandler` component
63+
* Replace uses of `Symfony\Component\Debug\Debug` by `Symfony\Component\ErrorHandler\Debug`
6364

6465
DependencyInjection
6566
-------------------

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public function getProxyFactoryCode(Definition $definition, string $id, string $
8181
public function getProxyCode(Definition $definition): string
8282
{
8383
$code = $this->classGenerator->generate($this->generateProxyClass($definition));
84+
$code = preg_replace('/^(class [^ ]++ extends )([^\\\\])/', '$1\\\\$2', $code);
8485

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

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt
+1-1Lines 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/Compiler/ResolveBindingsPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/ResolveBindingsPass.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Compiler;
1313

1414
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
15+
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
1516
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
1718
use Symfony\Component\DependencyInjection\Definition;
@@ -126,8 +127,8 @@ protected function processValue($value, bool $isRoot = false)
126127
continue;
127128
}
128129

129-
if (null !== $bindingValue && !$bindingValue instanceof Reference && !$bindingValue instanceof Definition && !$bindingValue instanceof TaggedIteratorArgument) {
130-
throw new InvalidArgumentException(sprintf('Invalid value for binding key "%s" for service "%s": expected null, an instance of %s or an instance of %s or an instance of %s, %s given.', $key, $this->currentId, Reference::class, Definition::class, TaggedIteratorArgument::class, \gettype($bindingValue)));
130+
if (null !== $bindingValue && !$bindingValue instanceof Reference && !$bindingValue instanceof Definition && !$bindingValue instanceof TaggedIteratorArgument && !$bindingValue instanceof ServiceLocatorArgument) {
131+
throw new InvalidArgumentException(sprintf('Invalid value for binding key "%s" for service "%s": expected null, %s, %s, %s or ServiceLocatorArgument, %s given.', $key, $this->currentId, Reference::class, Definition::class, TaggedIteratorArgument::class, \gettype($bindingValue)));
131132
}
132133
}
133134

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Extension/Extension.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ public function getAlias()
8181
public function getConfiguration(array $config, ContainerBuilder $container)
8282
{
8383
$class = \get_class($this);
84+
85+
if (false !== strpos($class, "\0")) {
86+
return null; // ignore anonymous classes
87+
}
88+
8489
$class = substr_replace($class, '\Configuration', strrpos($class, '\\'));
8590
$class = $container->getReflectionClass($class);
8691

‎src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveBindingsPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveBindingsPassTest.php
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
16+
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
1617
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
1718
use Symfony\Component\DependencyInjection\Compiler\AutowireRequiredMethodsPass;
1819
use Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass;
@@ -35,6 +36,7 @@ public function testProcess()
3536

3637
$bindings = [
3738
CaseSensitiveClass::class => new BoundArgument(new Reference('foo')),
39+
'Psr\Container\ContainerInterface $container' => new BoundArgument(new ServiceLocatorArgument([]), true, BoundArgument::INSTANCEOF_BINDING),
3840
'iterable $objects' => new BoundArgument(new TaggedIteratorArgument('tag.name'), true, BoundArgument::INSTANCEOF_BINDING),
3941
];
4042

@@ -49,7 +51,13 @@ public function testProcess()
4951
$pass = new ResolveBindingsPass();
5052
$pass->process($container);
5153

52-
$this->assertEquals([0 => new Reference('foo'), 1 => '123', 4 => new TaggedIteratorArgument('tag.name')], $definition->getArguments());
54+
$expected = [
55+
0 => new Reference('foo'),
56+
1 => '123',
57+
3 => new ServiceLocatorArgument([]),
58+
4 => new TaggedIteratorArgument('tag.name'),
59+
];
60+
$this->assertEquals($expected, $definition->getArguments());
5361
$this->assertEquals([['setSensitiveClass', [new Reference('foo')]]], $definition->getMethodCalls());
5462
}
5563

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/NamedArgumentsDummy.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/NamedArgumentsDummy.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
class NamedArgumentsDummy
1111
{
12-
public function __construct(CaseSensitiveClass $c, $apiKey, $hostName, ContainerInterface $interface, iterable $objects)
12+
public function __construct(CaseSensitiveClass $c, $apiKey, $hostName, ContainerInterface $container, iterable $objects)
1313
{
1414
}
1515

‎src/Symfony/Component/Dotenv/Dotenv.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Dotenv/Dotenv.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ private function resolveVariables(string $value, array $loadedVars): string
458458
} elseif (isset($this->values[$name])) {
459459
$value = $this->values[$name];
460460
} else {
461-
$value = '';
461+
$value = (string) getenv($name);
462462
}
463463

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

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Dotenv/Tests/DotenvTest.php
+11Lines 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
public function testNoDeprecationWarning()
447458
{
448459
$dotenv = new Dotenv(true);

‎src/Symfony/Component/HttpClient/Psr18Client.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/Psr18Client.php
+13-10Lines 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/Handler/PdoSessionHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -869,10 +869,10 @@ private function getMergeStatement(string $sessionId, string $data, int $maxlife
869869
$mergeStmt->bindParam(2, $sessionId, \PDO::PARAM_STR);
870870
$mergeStmt->bindParam(3, $data, \PDO::PARAM_LOB);
871871
$mergeStmt->bindValue(4, time() + $maxlifetime, \PDO::PARAM_INT);
872-
$mergeStmt->bindValue(4, time(), \PDO::PARAM_INT);
873-
$mergeStmt->bindParam(5, $data, \PDO::PARAM_LOB);
874-
$mergeStmt->bindValue(6, time() + $maxlifetime, \PDO::PARAM_INT);
875-
$mergeStmt->bindValue(6, time(), \PDO::PARAM_INT);
872+
$mergeStmt->bindValue(5, time(), \PDO::PARAM_INT);
873+
$mergeStmt->bindParam(6, $data, \PDO::PARAM_LOB);
874+
$mergeStmt->bindValue(7, time() + $maxlifetime, \PDO::PARAM_INT);
875+
$mergeStmt->bindValue(8, time(), \PDO::PARAM_INT);
876876
} else {
877877
$mergeStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
878878
$mergeStmt->bindParam(':data', $data, \PDO::PARAM_LOB);

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
+1-3Lines 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
*

‎src/Symfony/Component/HttpKernel/Kernel.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Kernel.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ public function write(string $content, array $metadata = null)
471471
}
472472

473473
if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
474-
opcache_invalidate($this->getPath(), true);
474+
@opcache_invalidate($this->getPath(), true);
475475
}
476476
}
477477

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.