diff --git a/src/Symfony/Bridge/Twig/AppVariable.php b/src/Symfony/Bridge/Twig/AppVariable.php index d342f9fbaf03f..6cdbaa8370811 100644 --- a/src/Symfony/Bridge/Twig/AppVariable.php +++ b/src/Symfony/Bridge/Twig/AppVariable.php @@ -159,7 +159,7 @@ public function getFlashes(string|array $types = null): array return $result; } - public function getCurrent_Route(): ?string + public function getCurrent_route(): ?string { if (!isset($this->requestStack)) { throw new \RuntimeException('The "app.current_route" variable is not available.'); @@ -171,7 +171,7 @@ public function getCurrent_Route(): ?string /** * @return array */ - public function getCurrent_Route_Parameters(): array + public function getCurrent_route_parameters(): array { if (!isset($this->requestStack)) { throw new \RuntimeException('The "app.current_route_parameters" variable is not available.'); diff --git a/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php b/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php index 01db44528a0d4..ab3702faac932 100644 --- a/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php +++ b/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php @@ -232,13 +232,13 @@ public function testGetCurrentRoute() { $this->setRequestStack(new Request(attributes: ['_route' => 'some_route'])); - $this->assertSame('some_route', $this->appVariable->getCurrent_Route()); + $this->assertSame('some_route', $this->appVariable->getCurrent_route()); } public function testGetCurrentRouteWithRequestStackNotSet() { $this->expectException(\RuntimeException::class); - $this->appVariable->getCurrent_Route(); + $this->appVariable->getCurrent_route(); } public function testGetCurrentRouteParameters() @@ -246,20 +246,20 @@ public function testGetCurrentRouteParameters() $routeParams = ['some_param' => true]; $this->setRequestStack(new Request(attributes: ['_route_params' => $routeParams])); - $this->assertSame($routeParams, $this->appVariable->getCurrent_Route_Parameters()); + $this->assertSame($routeParams, $this->appVariable->getCurrent_route_parameters()); } public function testGetCurrentRouteParametersWithoutAttribute() { $this->setRequestStack(new Request()); - $this->assertSame([], $this->appVariable->getCurrent_Route_Parameters()); + $this->assertSame([], $this->appVariable->getCurrent_route_parameters()); } public function testGetCurrentRouteParametersWithRequestStackNotSet() { $this->expectException(\RuntimeException::class); - $this->appVariable->getCurrent_Route_Parameters(); + $this->appVariable->getCurrent_route_parameters(); } protected function setRequestStack($request)