Merge branch '5.1' into 5.x
This commit is contained in:
commit
5c5b8d61ee
@ -11,9 +11,10 @@
|
||||
|
||||
namespace Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper;
|
||||
|
||||
use ProxyManager\Exception\ExceptionInterface;
|
||||
use ProxyManager\Generator\ClassGenerator;
|
||||
use ProxyManager\Generator\MethodGenerator;
|
||||
use ProxyManager\GeneratorStrategy\BaseGeneratorStrategy;
|
||||
use ProxyManager\Version;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface;
|
||||
|
||||
@ -83,7 +84,7 @@ EOF;
|
||||
$code = $this->classGenerator->generate($this->generateProxyClass($definition));
|
||||
$code = preg_replace('/^(class [^ ]++ extends )([^\\\\])/', '$1\\\\$2', $code);
|
||||
|
||||
if (version_compare(self::getProxyManagerVersion(), '2.2', '<')) {
|
||||
if (!method_exists(MethodGenerator::class, 'fromReflectionWithoutBodyAndDocBlock')) { // proxy-manager < 2.2
|
||||
$code = preg_replace(
|
||||
'/((?:\$(?:this|initializer|instance)->)?(?:publicProperties|initializer|valueHolder))[0-9a-f]++/',
|
||||
'${1}'.$this->getIdentifierSuffix($definition),
|
||||
@ -91,22 +92,13 @@ EOF;
|
||||
);
|
||||
}
|
||||
|
||||
if (version_compare(self::getProxyManagerVersion(), '2.5', '<')) {
|
||||
if (!is_subclass_of(ExceptionInterface::class, 'Throwable')) { // proxy-manager < 2.5
|
||||
$code = preg_replace('/ \\\\Closure::bind\(function ((?:& )?\(\$instance(?:, \$value)?\))/', ' \Closure::bind(static function \1', $code);
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
private static function getProxyManagerVersion(): string
|
||||
{
|
||||
if (!class_exists(Version::class)) {
|
||||
return '0.0.1';
|
||||
}
|
||||
|
||||
return \defined(Version::class.'::VERSION') ? Version::VERSION : Version::getVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces the proxy class name for the given definition.
|
||||
*/
|
||||
|
@ -62,7 +62,7 @@ class DoctrineIntegrationTest extends TestCase
|
||||
->select('m.available_at')
|
||||
->from('messenger_messages', 'm')
|
||||
->where('m.body = :body')
|
||||
->setParameter(':body', '{"message": "Hi i am delayed"}')
|
||||
->setParameter('body', '{"message": "Hi i am delayed"}')
|
||||
->execute();
|
||||
|
||||
$available_at = new \DateTime($stmt instanceof Result || $stmt instanceof DriverResult ? $stmt->fetchOne() : $stmt->fetchColumn());
|
||||
|
Reference in New Issue
Block a user