Skip to content

Commit 5a403e6

Browse files
committed
moved Twig runtime to proper class
1 parent 56f33ca commit 5a403e6

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

Extension/FormExtension.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function getFilters()
9696
{
9797
return array(
9898
new TwigFilter('humanize', array('Symfony\Component\Form\FormRenderer', 'humanize')),
99-
new TwigFilter('form_encode_currency', array($this, 'encodeCurrency'), array('is_safe' => array('html'), 'needs_environment' => true)),
99+
new TwigFilter('form_encode_currency', array('Symfony\Component\Form\FormRenderer', 'encodeCurrency'), array('is_safe' => array('html'), 'needs_environment' => true)),
100100
);
101101
}
102102

@@ -167,22 +167,6 @@ public function __unset($name)
167167
unset($this->$name);
168168
}
169169

170-
/**
171-
* @internal
172-
*/
173-
public function encodeCurrency(Environment $environment, $text, $widget = '')
174-
{
175-
if ('UTF-8' === $charset = $environment->getCharset()) {
176-
$text = htmlspecialchars($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
177-
} else {
178-
$text = htmlentities($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
179-
$text = iconv('UTF-8', $charset, $text);
180-
$widget = iconv('UTF-8', $charset, $widget);
181-
}
182-
183-
return str_replace('{{ widget }}', $widget, $text);
184-
}
185-
186170
/**
187171
* {@inheritdoc}
188172
*/

0 commit comments

Comments
 (0)