Move things around

This commit is contained in:
Fabien Potencier
2021-01-01 15:49:07 +01:00
parent 7314edbb8a
commit 1868918724
73 changed files with 50 additions and 70 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
/*
* This file is part of Twig.
*
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Twig\Extra\String;
use Symfony\Component\String\UnicodeString;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
final class StringExtension extends AbstractExtension
{
public function getFilters()
{
return [
new TwigFilter('u', [$this, 'createUnicodeString']),
];
}
public function createUnicodeString(?string $text): UnicodeString
{
return new UnicodeString($text ?? '');
}
}