src/Factory.php
public function create(): \Twig\Environment
    {
        $twig = new \Twig\Environment($this->loader, $this->options);
        $modules = (new Provider($twig))->modules();

        foreach ($modules as $module) {
            if (!$module instanceof Module\Injectable) {
                continue;
            }

            // Add the module into Twig.
            $module->injectInto($twig);
        }

        return $twig;
    }
public function create(): \Twig\Environment
    {
        $twig = new \Twig\Environment($this->loader, $this->options);
        $modules = (new Provider($twig))->modules();

        foreach ($modules as $module) {
            if (!$module instanceof Module\Injectable) {
                continue;
            }

            // Add the module into Twig.
            $module->injectInto($twig);
        }

        return $twig;
    }
public function create ( ) : \ Twig \ Environment { $ twig = new \ Twig \ Environment ( $ this -> loader , $ this -> options ) ; $ modules = ( new Provider ( $ twig ) ) -> modules ( ) ; foreach ( $ modules as $ module ) { if ( ! $ module instanceof Module \ Injectable ) { continue ; } // Add the module into Twig. $ module -> injectInto ( $ twig ) ; } return $ twig ; }
Create Instance of Twig Environment

@since 1.0.0

@return \Twig\Environment The new instance of the environment
Create Instance of Twig Environment