8000 minor #35966 Use some PHP 5.4 constants unconditionally (fancyweb) · symfony/symfony@600b2b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 600b2b5

Browse files
committed
minor #35966 Use some PHP 5.4 constants unconditionally (fancyweb)
This PR was merged into the 3.4 branch. Discussion ---------- Use some PHP 5.4 constants unconditionally | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Since we are PHP >= 5.5.9 only, we can use those constants unconditionally. Commits ------- 0caf947 Use some PHP 5.4 constants unconditionally
2 parents 3a8da96 + 0caf947 commit 600b2b5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
243243
public function formEncodeCurrency($text, $widget = '')
244244
{
245245
if ('UTF-8' === $charset = $this->getCharset()) {
246-
$text = htmlspecialchars($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
246+
$text = htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
247247
} else {
248-
$text = htmlentities($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
248+
$text = htmlentities($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
249249
$text = iconv('UTF-8', $charset, $text);
250250
$widget = iconv('UTF-8', $charset, $widget);
251251
}

src/Symfony/Component/Form/FormRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ public function humanize($text)
291291
public function encodeCurrency(Environment $environment, $text, $widget = '')
292292
{
293293
if ('UTF-8' === $charset = $environment->getCharset()) {
294-
$text = htmlspecialchars($text, ENT_QUOTES | (\defined('ENT_SU B55C BSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
294+
$text = htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
295295
} else {
296-
$text = htmlentities($text, ENT_QUOTES | (\defined('ENT_SUBSTITUTE') ? ENT_SUBSTITUTE : 0), 'UTF-8');
296+
$text = htmlentities($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
297297
$text = iconv('UTF-8', $charset, $text);
298298
$widget = iconv('UTF-8', $charset, $widget);
299299
}

src/Symfony/Component/Translation/Dumper/JsonFileDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
2828
if (isset($options['json_encoding'])) {
2929
$flags = $options['json_encoding'];
3030
} else {
31-
$flags = \defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
31+
$flags = JSON_PRETTY_PRINT;
3232
}
3333

3434
return json_encode($messages->all($domain), $flags);

0 commit comments

Comments
 (0)
0