mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-24 21:36:25 +00:00
Move things around
This commit is contained in:
@@ -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 ?? '');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user