mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-18 21:37:29 +00:00
Identity Equals - Best practices
This commit is contained in:
committed by
Fabien Potencier
parent
59373af88c
commit
60d5b4bcf7
@@ -539,11 +539,11 @@ function twig_replace_filter($str, $from, $to = null)
|
|||||||
*/
|
*/
|
||||||
function twig_round($value, $precision = 0, $method = 'common')
|
function twig_round($value, $precision = 0, $method = 'common')
|
||||||
{
|
{
|
||||||
if ('common' == $method) {
|
if ('common' === $method) {
|
||||||
return round($value, $precision);
|
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.');
|
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)
|
function twig_test_empty($value)
|
||||||
{
|
{
|
||||||
if ($value instanceof \Countable) {
|
if ($value instanceof \Countable) {
|
||||||
return 0 == \count($value);
|
return 0 === \count($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($value instanceof \Traversable) {
|
if ($value instanceof \Traversable) {
|
||||||
|
|||||||
Reference in New Issue
Block a user