Skip to content

Commit 5b76548

Browse files
committed
[TwigBridge] Fix casing of currentRoute/currentRouteParameters methods
1 parent 414302d commit 5b76548

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

AppVariable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function getFlashes(string|array $types = null): array
159159
return $result;
160160
}
161161

162-
public function getCurrent_Route(): ?string
162+
public function getCurrent_route(): ?string
163163
{
164164
if (!isset($this->requestStack)) {
165165
throw new \RuntimeException('The "app.current_route" variable is not available.');
@@ -171,7 +171,7 @@ public function getCurrent_Route(): ?string
171171
/**
172172
* @return array<string, mixed>
173173
*/
174-
public function getCurrent_Route_Parameters(): array
174+
public function getCurrent_route_parameters(): array
175175
{
176176
if (!isset($this->requestStack)) {
177177
throw new \RuntimeException('The "app.current_route_parameters" variable is not available.');

Tests/AppVariableTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,34 +232,34 @@ public function testGetCurrentRoute()
232232
{
233233
$this->setRequestStack(new Request(attributes: ['_route' => 'some_route']));
234234

235-
$this->assertSame('some_route', $this->appVariable->getCurrent_Route());
235+
$this->assertSame('some_route', $this->appVariable->getCurrent_route());
236236
}
237237

238238
public function testGetCurrentRouteWithRequestStackNotSet()
239239
{
240240
$this->expectException(\RuntimeException::class);
241-
$this->appVariable->getCurrent_Route();
241+
$this->appVariable->getCurrent_route();
242242
}
243243

244244
public function testGetCurrentRouteParameters()
245245
{
246246
$routeParams = ['some_param' => true];
247247
$this->setRequestStack(new Request(attributes: ['_route_params' => $routeParams]));
248248

249-
$this->assertSame($routeParams, $this->appVariable->getCurrent_Route_Parameters());
249+
$this->assertSame($routeParams, $this->appVariable->getCurrent_route_parameters());
250250
}
251251

252252
public function testGetCurrentRouteParametersWithoutAttribute()
253253
{
254254
$this->setRequestStack(new Request());
255255

256-
$this->assertSame([], $this->appVariable->getCurrent_Route_Parameters());
256+
$this->assertSame([], $this->appVariable->getCurrent_route_parameters());
257257
}
258258

259259
public function testGetCurrentRouteParametersWithRequestStackNotSet()
260260
{
261261
$this->expectException(\RuntimeException::class);
262-
$this->appVariable->getCurrent_Route_Parameters();
262+
$this->appVariable->getCurrent_route_parameters();
263263
}
264264

265265
protected function setRequestStack($request)

0 commit comments

Comments
 (0)