10000 moved the deprecation logic calls outside the new HttpContentRenderer… · symfony/symfony@2eea768 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2eea768

Browse files
committed
moved the deprecation logic calls outside the new HttpContentRenderer class
1 parent bd102c5 commit 2eea768

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line num 10000 berDiff line change
@@ -54,6 +54,8 @@ public function getFunctions()
5454
*/
5555
public function render($uri, $options = array())
5656
{
57+
$options = $this->renderer->fixOptions($options);
58+
5759
$strategy = isset($options['strategy']) ? $options['strategy'] : 'default';
5860
unset($options['strategy']);
5961

src/Symfony/Bundle/FrameworkBundle/HttpKernel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public function render($uri, array $options = array())
105105
{
106106
trigger_error('render() is deprecated since version 2.2 and will be removed in 2.3. Use Symfony\Component\HttpKernel\HttpContentRenderer::render() instead.', E_USER_DEPRECATED);
107107

108+
$options = $this->renderer->fixOptions($options);
109+
108110
$strategy = isset($options['strategy']) ? $options['strategy'] : 'default';
109111
unset($options['strategy']);
110112

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public function __construct(HttpContentRenderer $renderer)
4646
*/
4747
public function render($uri, array $options = array())
4848
{
49+
$options = $this->renderer->fixOptions($options);
50+
4951
$strategy = isset($options['strategy']) ? $options['strategy'] : 'default';
5052
unset($options['strategy']);
5153

src/Symfony/Component/HttpKernel/HttpContentRenderer.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ public function render($uri, $strategy = 'default', array $options = array())
9797
$options['ignore_errors'] = !$this->debug;
9898
}
9999

100-
$options = $this->fixOptions($options);
101-
if (isset($options['strategy'])) {
102-
$strategy = $options['strategy'];
103-
}
104-
105100
if (!isset($this->strategies[$strategy])) {
106101
throw new \InvalidArgumentException(sprintf('The "%s" rendering strategy does not exist.', $strategy));
107102
}
@@ -118,7 +113,7 @@ public static function getSubscribedEvents()
118113
}
119114

120115
// to be removed in 2.3
121-
private function fixOptions($options)
116+
public function fixOptions(array $options)
122117
{
123118
// support for the standalone option is @deprecated in 2.2 and replaced with the strategy option
124119
if (isset($options['standalone'])) {
@@ -136,6 +131,7 @@ private function fixOptions($options)
136131
}
137132

138133
$options['strategy'] = $options['standalone'];
134+
unset($options['standalone']);
139135
}
140136

141137
return $options;

0 commit comments

Comments
 (0)
0