Skip to content

Commit 7a4fe8c

Browse files
committed
bug symfony#24431 [FrameworkBundle] Fix bad interface hint in AbstractController (nicolas-grekas)
This PR was merged into the 3.3 branch. Discussion ---------- [FrameworkBundle] Fix bad interface hint in AbstractController | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As spotted by @stof Commits ------- 5d29dd0 [FrameworkBundle] Fix bad interface hint in AbstractController
2 parents fc9acad + 5d29dd0 commit 7a4fe8c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,18 +231,18 @@ protected function renderView($view, array $parameters = array())
231231
protected function render($view, array $parameters = array(), Response $response = null)
232232
{
233233
if ($this->container->has('templating')) {
234-
return $this->container->get('templating')->renderResponse($view, $parameters, $response);
235-
}
236-
237-
if (!$this->container->has('twig')) {
234+
$content = $this->container->get('templating')->render($view, $parameters);
235+
} elseif ($this->container->has('twig')) {
236+
$content = $this->container->get('twig')->render($view, $parameters);
237+
} else {
238238
throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available.');
239239
}
240240

241241
if (null === $response) {
242242
$response = new Response();
243243
}
244244

245-
$response->setContent($this->container->get('twig')->render($view, $parameters));
245+
$response->setContent($content);
246246

247247
return $response;
248248
}

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public function testRenderViewTemplating()
451451
public function testRenderTemplating()
452452
{
453453
$templating = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface')->getMock();
454-
$templating->expects($this->once())->method('renderResponse')->willReturn(new Response('bar'));
454+
$templating->expects($this->once())->method('render')->willReturn('bar');
455455

456456
$container = new Container();
457457
$container->set('templating', $templating);

0 commit comments

Comments
 (0)