mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 12:06:56 +00:00
Fix CS
This commit is contained in:
@@ -547,7 +547,7 @@ function twig_round($value, $precision = 0, $method = 'common')
|
||||
throw new RuntimeError('The round filter only supports the "common", "ceil", and "floor" methods.');
|
||||
}
|
||||
|
||||
return $method($value * pow(10, $precision)) / pow(10, $precision);
|
||||
return $method($value * 10 ** $precision) / 10 ** $precision;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -167,7 +167,7 @@ class FilesystemTest extends \PHPUnit\Framework\TestCase
|
||||
public function testGenerateKey($expected, $input)
|
||||
{
|
||||
$cache = new FilesystemCache($input);
|
||||
$this->assertMatchesRegularExpression($expected, $cache->generateKey('_test_', \get_class($this)));
|
||||
$this->assertMatchesRegularExpression($expected, $cache->generateKey('_test_', static::class));
|
||||
}
|
||||
|
||||
public function provideDirectories()
|
||||
|
||||
+2
-2
@@ -212,14 +212,14 @@ EOHTML
|
||||
|
||||
public function testTwigLeakOutputInDebugMode()
|
||||
{
|
||||
$output = exec(sprintf('%s %s debug', \PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php')));
|
||||
$output = exec(sprintf('%s %s debug', PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php')));
|
||||
|
||||
$this->assertSame('Hello OOPS', $output);
|
||||
}
|
||||
|
||||
public function testDoesNotTwigLeakOutput()
|
||||
{
|
||||
$output = exec(sprintf('%s %s', \PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php')));
|
||||
$output = exec(sprintf('%s %s', PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php')));
|
||||
|
||||
$this->assertSame('', $output);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class SandboxTest extends \PHPUnit\Framework\TestCase
|
||||
'1_include' => '{{ include("1_basic1", sandboxed=true) }}',
|
||||
'1_range_operator' => '{{ (1..2)[0] }}',
|
||||
'1_syntax_error_wrapper' => '{% sandbox %}{% include "1_syntax_error" %}{% endsandbox %}',
|
||||
'1_syntax_error' => '{% syntax error }}'
|
||||
'1_syntax_error' => '{% syntax error }}',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -335,7 +335,6 @@ EOF
|
||||
$this->expectException('\Twig\Error\RuntimeError');
|
||||
$this->expectExceptionMessage('The callable passed to "filter" filter must be a Closure in sandbox mode in "index" at line 1.');
|
||||
|
||||
|
||||
$twig = $this->getEnvironment(true, ['autoescape' => 'html'], ['index' => <<<EOF
|
||||
{{ ["foo", "bar", ""]|filter("trim")|join(", ") }}
|
||||
EOF
|
||||
|
||||
@@ -20,7 +20,7 @@ class BrokenExtension extends AbstractExtension
|
||||
|
||||
public function broken()
|
||||
{
|
||||
die('OOPS');
|
||||
exit('OOPS');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@ abstract class AbstractTest extends \PHPUnit\Framework\TestCase
|
||||
* @param bool $isTemplate
|
||||
* @param string $type
|
||||
* @param string $templateName
|
||||
* @param array $subProfiles
|
||||
*
|
||||
* @return Profile
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Twig\Tests;
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (https://www.zend.com)
|
||||
* @license https://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Twig_Test_EscapingTest extends \PHPUnit\Framework\TestCase
|
||||
class escapingTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* All character encodings supported by htmlspecialchars().
|
||||
|
||||
Reference in New Issue
Block a user