Identity Equals - Best practices

This commit is contained in:
Hector Prats
2020-02-21 01:19:11 +01:00
committed by Fabien Potencier
parent 59373af88c
commit 60d5b4bcf7
+3 -3
View File
@@ -539,11 +539,11 @@ function twig_replace_filter($str, $from, $to = null)
*/
function twig_round($value, $precision = 0, $method = 'common')
{
if ('common' == $method) {
if ('common' === $method) {
return round($value, $precision);
}
if ('ceil' != $method && 'floor' != $method) {
if ('ceil' !== $method && 'floor' !== $method) {
throw new RuntimeError('The round filter only supports the "common", "ceil", and "floor" methods.');
}
@@ -1504,7 +1504,7 @@ function twig_to_array($seq, $preserveKeys = true)
function twig_test_empty($value)
{
if ($value instanceof \Countable) {
return 0 == \count($value);
return 0 === \count($value);
}
if ($value instanceof \Traversable) {