This commit is contained in:
Sampanna Rimal
2024-09-04 12:22:04 +05:45
parent 53c0140f58
commit 82fab174dc
203 changed files with 4255 additions and 1343 deletions

View File

@ -240,7 +240,7 @@ class ControllerResolver implements ControllerResolverInterface
$r = new \ReflectionFunction($controller);
$name = $r->name;
if (str_contains($name, '{closure}')) {
if (str_contains($name, '{closure')) {
$name = $class = \Closure::class;
} elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
$class = $class->name;

View File

@ -63,9 +63,21 @@ abstract class DataCollector implements DataCollectorInterface
$casters = [
'*' => function ($v, array $a, Stub $s, $isNested) {
if (!$v instanceof Stub) {
$b = $a;
foreach ($a as $k => $v) {
if (\is_object($v) && !$v instanceof \DateTimeInterface && !$v instanceof Stub) {
$a[$k] = new CutStub($v);
if (!\is_object($v) || $v instanceof \DateTimeInterface || $v instanceof Stub) {
continue;
}
try {
$a[$k] = $s = new CutStub($v);
if ($b[$k] === $s) {
// we've hit a non-typed reference
$a[$k] = $v;
}
} catch (\TypeError $e) {
// we've hit a typed reference
}
}
}

View File

@ -505,7 +505,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
'line' => $r->getStartLine(),
];
if (str_contains($r->name, '{closure}')) {
if (str_contains($r->name, '{closure')) {
return $controller;
}
$controller['method'] = $r->name;

View File

@ -59,6 +59,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
foreach ($container->findTaggedServiceIds('controller.service_arguments', true) as $id => $tags) {
$def = $container->getDefinition($id);
$def->setPublic(true);
$def->setLazy(false);
$class = $def->getClass();
$autowire = $def->isAutowired();
$bindings = $def->getBindings();

View File

@ -98,7 +98,7 @@ final class ControllerEvent extends KernelEvent
} elseif (\is_string($this->controller) && false !== $i = strpos($this->controller, '::')) {
$class = new \ReflectionClass(substr($this->controller, 0, $i));
} else {
$class = str_contains($this->controllerReflector->name, '{closure}') ? null : (\PHP_VERSION_ID >= 80111 ? $this->controllerReflector->getClosureCalledClass() : $this->controllerReflector->getClosureScopeClass());
$class = str_contains($this->controllerReflector->name, '{closure') ? null : (\PHP_VERSION_ID >= 80111 ? $this->controllerReflector->getClosureCalledClass() : $this->controllerReflector->getClosureScopeClass());
}
$this->attributes = [];

View File

@ -76,11 +76,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
*/
private static array $freshCache = [];
public const VERSION = '6.4.6';
public const VERSION_ID = 60406;
public const VERSION = '6.4.7';
public const VERSION_ID = 60407;
public const MAJOR_VERSION = 6;
public const MINOR_VERSION = 4;
public const RELEASE_VERSION = 6;
public const RELEASE_VERSION = 7;
public const EXTRA_VERSION = '';
public const END_OF_MAINTENANCE = '11/2026';

View File

@ -44,6 +44,7 @@
"symfony/translation-contracts": "^2.5|^3",
"symfony/uid": "^5.4|^6.0|^7.0",
"symfony/validator": "^6.4|^7.0",
"symfony/var-dumper": "^5.4|^6.4|^7.0",
"symfony/var-exporter": "^6.2|^7.0",
"psr/cache": "^1.0|^2.0|^3.0",
"twig/twig": "^2.13|^3.0.4"