|
25 | 25 | use Symfony\Component\Console\Logger\ConsoleLogger;
|
26 | 26 | use Symfony\Component\Console\Output\OutputInterface;
|
27 | 27 | use Symfony\Component\Yaml\Parser;
|
| 28 | +use Twig\Environment; |
| 29 | +use Twig\Extension\DebugExtension; |
| 30 | +use Twig\Loader\FilesystemLoader; |
| 31 | +use Twig\TwigFilter; |
28 | 32 |
|
29 | 33 | /**
|
30 | 34 | * Generate entities command.
|
@@ -149,14 +153,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
|
149 | 153 | $templatePaths = $processedConfiguration['generatorTemplates'];
|
150 | 154 | $templatePaths[] = __DIR__.'/../../templates/';
|
151 | 155 |
|
152 |
| - $loader = new \Twig_Loader_Filesystem($templatePaths); |
153 |
| - $twig = new \Twig_Environment($loader, ['autoescape' => false, 'debug' => $processedConfiguration['debug']]); |
154 |
| - $twig->addFilter(new \Twig_SimpleFilter('ucfirst', 'ucfirst')); |
155 |
| - $twig->addFilter(new \Twig_SimpleFilter('pluralize', [Inflector::class, 'pluralize'])); |
156 |
| - $twig->addFilter(new \Twig_SimpleFilter('singularize', [Inflector::class, 'singularize'])); |
| 156 | + $loader = new FilesystemLoader($templatePaths); |
| 157 | + $twig = new Environment($loader, ['autoescape' => false, 'debug' => $processedConfiguration['debug']]); |
| 158 | + $twig->addFilter(new TwigFilter('ucfirst', 'ucfirst')); |
| 159 | + $twig->addFilter(new TwigFilter('pluralize', [Inflector::class, 'pluralize'])); |
| 160 | + $twig->addFilter(new TwigFilter('singularize', [Inflector::class, 'singularize'])); |
157 | 161 |
|
158 | 162 | if ($processedConfiguration['debug']) {
|
159 |
| - $twig->addExtension(new \Twig_Extension_Debug()); |
| 163 | + $twig->addExtension(new DebugExtension()); |
160 | 164 | }
|
161 | 165 |
|
162 | 166 | $logger = new ConsoleLogger($output);
|
|
0 commit comments