@@ -39,14 +39,14 @@ public function boot()
3939 $ loader = $ twig ->getLoader ();
4040
4141 // If the loader is not already a chain, make it one
42- if (! $ loader instanceof \Twig_Loader_Chain ) {
43- $ loader = new \Twig_Loader_Chain ([$ loader ]);
42+ if (! $ loader instanceof \Twig \ Loader \ChainLoader ) {
43+ $ loader = new \Twig \ Loader \ ChainLoader ([$ loader ]);
4444 $ twig ->setLoader ($ loader );
4545 }
4646
47- $ loader ->addLoader (new \Twig_Loader_Filesystem ($ this ->getTemplateDirectories ()));
47+ $ loader ->addLoader (new \Twig \ Loader \ FilesystemLoader ($ this ->getTemplateDirectories ()));
4848
49- $ twig ->addRuntimeLoader (new \Twig_FactoryRuntimeLoader (array (
49+ $ twig ->addRuntimeLoader (new \Twig \ RuntimeLoader \ FactoryRuntimeLoader (array (
5050 \Symfony \Component \Form \FormRenderer::class => function () {
5151 return $ this ->app ->make (\Symfony \Component \Form \FormRenderer::class);
5252 }
@@ -56,15 +56,15 @@ public function boot()
5656 $ twig ->addExtension (new FormExtension ());
5757
5858 // trans filter is used in the forms
59- $ twig ->addFilter (new \Twig_SimpleFilter ('trans ' , function ($ id = null , $ replace = [], $ locale = null ) {
59+ $ twig ->addFilter (new \Twig \ TwigFilter ('trans ' , function ($ id = null , $ replace = [], $ locale = null ) {
6060 if (empty ($ id )) {
6161 return '' ;
6262 }
6363 return app ('translator ' )->get ($ id , $ replace , $ locale );
6464 }));
6565
6666 // csrf_token needs to be replaced for Laravel
67- $ twig ->addFunction (new \Twig_SimpleFunction ('csrf_token ' , 'csrf_token ' ));
67+ $ twig ->addFunction (new \Twig \ TwigFunction ('csrf_token ' , 'csrf_token ' ));
6868
6969 $ this ->registerBladeDirectives ();
7070 $ this ->registerViewComposer ();
@@ -203,19 +203,19 @@ protected function getTemplateDirectories()
203203 /**
204204 * Get or create a new TwigEnvironment
205205 *
206- * @return \Twig_Environment
206+ * @return \Twig\Environment
207207 */
208208 protected function getTwigEnvironment ()
209209 {
210- if (! $ this ->app ->bound (\Twig_Environment ::class)) {
211- $ this ->app ->singleton (\Twig_Environment ::class, function () {
212- return new \Twig_Environment (new \Twig_Loader_Chain ([]), [
210+ if (! $ this ->app ->bound (\Twig \Environment ::class)) {
211+ $ this ->app ->singleton (\Twig \Environment ::class, function () {
212+ return new \Twig \ Environment (new \Twig \ Loader \ ChainLoader ([]), [
213213 'cache ' => storage_path ('framework/views/twig ' ),
214214 ]);
215215 });
216216 }
217217
218- /** @var \Twig_Environment $twig */
219- return $ this ->app ->make (\Twig_Environment ::class);
218+ /** @var \Twig\Environment $twig */
219+ return $ this ->app ->make (\Twig \Environment ::class);
220220 }
221221}
0 commit comments