mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 12:06:56 +00:00
fixed CS
This commit is contained in:
@@ -348,7 +348,7 @@ namespace {
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Cycles over a value.
|
||||
*
|
||||
* @param \ArrayAccess|array $values
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user