diff --git a/src/Extension/CoreExtension.php b/src/Extension/CoreExtension.php index bc837fcb2..866d99035 100644 --- a/src/Extension/CoreExtension.php +++ b/src/Extension/CoreExtension.php @@ -348,7 +348,7 @@ namespace { use Twig\Source; use Twig\Template; -/** + /** * Cycles over a value. * * @param \ArrayAccess|array $values diff --git a/src/Extension/HtmlExtension.php b/src/Extension/HtmlExtension.php index 1aa1f8c4c..7e83083eb 100644 --- a/src/Extension/HtmlExtension.php +++ b/src/Extension/HtmlExtension.php @@ -54,14 +54,14 @@ final class HtmlExtension extends AbstractExtension if (!class_exists(MimeTypes::class)) { throw new \LogicException('The "data_uri" function requires the symfony/mime package to be installed.'); } - + $this->mimeTypes = new MimeTypes(); } try { $tmp = tempnam(sys_get_temp_dir(), 'mime'); file_put_contents($tmp, $data); - + if (null === $mime = $this->mimeTypes->guessMimeType($tmp)) { $mime = 'text/plain'; } @@ -93,12 +93,12 @@ function twig_html_classes(...$args): string { $classes = []; foreach ($args as $i => $arg) { - if (is_string($arg)) { + if (\is_string($arg)) { $classes[] = $arg; - } elseif (is_array($arg)) { + } elseif (\is_array($arg)) { foreach ($arg as $class => $condition) { - if (!is_string($class)) { - throw new RuntimeError(sprintf('The html_classes function argument %d (key %d) should be a string, got "%s".', $i, $class, gettype($class))); + if (!\is_string($class)) { + throw new RuntimeError(sprintf('The html_classes function argument %d (key %d) should be a string, got "%s".', $i, $class, \gettype($class))); } if (!$condition) { continue; @@ -106,7 +106,7 @@ function twig_html_classes(...$args): string $classes[] = $class; } } else { - throw new RuntimeError(sprintf('The html_classes function argument %d should be either a string or an array, got "%s".', $i, gettype($arg))); + throw new RuntimeError(sprintf('The html_classes function argument %d should be either a string or an array, got "%s".', $i, \gettype($arg))); } } diff --git a/tests/ParserTest.php b/tests/ParserTest.php index 16a0efb12..8920f9fca 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -14,7 +14,6 @@ namespace Twig\Tests; use PHPUnit\Framework\TestCase; use Twig\Environment; use Twig\Loader\LoaderInterface; -use Twig\Node\MacroNode; use Twig\Node\Node; use Twig\Node\SetNode; use Twig\Node\TextNode; diff --git a/tests/Profiler/Dumper/AbstractTest.php b/tests/Profiler/Dumper/AbstractTest.php index 3a11433cd..daaf83cd1 100644 --- a/tests/Profiler/Dumper/AbstractTest.php +++ b/tests/Profiler/Dumper/AbstractTest.php @@ -11,9 +11,8 @@ namespace Twig\Tests\Profiler\Dumper; * file that was distributed with this source code. */ -use Twig\Profiler\Profile; - use PHPUnit\Framework\TestCase; +use Twig\Profiler\Profile; abstract class AbstractTest extends TestCase {