mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 04:27:00 +00:00
fixed CS
This commit is contained in:
+3
-3
@@ -49,9 +49,9 @@ class Error extends \Exception
|
||||
*
|
||||
* By default, automatic guessing is enabled.
|
||||
*
|
||||
* @param string $message The error message
|
||||
* @param int $lineno The template line where the error occurred
|
||||
* @param Source|null $source The source context where the error occurred
|
||||
* @param string $message The error message
|
||||
* @param int $lineno The template line where the error occurred
|
||||
* @param Source|null $source The source context where the error occurred
|
||||
*/
|
||||
public function __construct(string $message, int $lineno = -1, Source $source = null, \Exception $previous = null)
|
||||
{
|
||||
|
||||
@@ -923,7 +923,7 @@ function twig_in_filter($value, $compare)
|
||||
}
|
||||
|
||||
if (\is_object($value) || \is_resource($value)) {
|
||||
if (!is_array($compare)) {
|
||||
if (!\is_array($compare)) {
|
||||
foreach ($compare as $item) {
|
||||
if ($item === $value) {
|
||||
return true;
|
||||
@@ -933,7 +933,7 @@ function twig_in_filter($value, $compare)
|
||||
return false;
|
||||
}
|
||||
|
||||
return in_array($value, $compare, true);
|
||||
return \in_array($value, $compare, true);
|
||||
}
|
||||
|
||||
foreach ($compare as $item) {
|
||||
@@ -956,7 +956,7 @@ function twig_in_filter($value, $compare)
|
||||
function twig_compare($a, $b)
|
||||
{
|
||||
// int <=> string
|
||||
if (is_int($a) && is_string($b)) {
|
||||
if (\is_int($a) && \is_string($b)) {
|
||||
$b = trim($b);
|
||||
if (!is_numeric($b)) {
|
||||
return (string) $a <=> $b;
|
||||
@@ -967,7 +967,7 @@ function twig_compare($a, $b)
|
||||
return (float) $a <=> (float) $b;
|
||||
}
|
||||
}
|
||||
if (is_string($a) && is_int($b)) {
|
||||
if (\is_string($a) && \is_int($b)) {
|
||||
$a = trim($a);
|
||||
if (!is_numeric($a)) {
|
||||
return $a <=> (string) $b;
|
||||
@@ -980,7 +980,7 @@ function twig_compare($a, $b)
|
||||
}
|
||||
|
||||
// float <=> string
|
||||
if (is_float($a) && is_string($b)) {
|
||||
if (\is_float($a) && \is_string($b)) {
|
||||
if (is_nan($a)) {
|
||||
return 1;
|
||||
}
|
||||
@@ -990,7 +990,7 @@ function twig_compare($a, $b)
|
||||
|
||||
return (float) $a <=> $b;
|
||||
}
|
||||
if (is_float($b) && is_string($a)) {
|
||||
if (\is_float($b) && \is_string($a)) {
|
||||
if (is_nan($b)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ class Twig_Tests_Extension_CoreTest extends \PHPUnit\Framework\TestCase
|
||||
[0, INF, 'INF'],
|
||||
[0, -INF, '-INF'],
|
||||
[0, INF, '1e1000'],
|
||||
[0, -INF,'-1e1000'],
|
||||
[0, -INF, '-1e1000'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user