original_string: protected function initTwigEnvironment()
      {
          $this->loader = new TwigLoader;
  
          $useCache = !Config::get('cms.twigNoCache');
          $isDebugMode = Config::get('app.debug', false);
          $strictVariables = Config::get('cms.enableTwigStrictVariables', false);
          $strictVariables = $strictVariables ?? $isDebugMode;
          $forceBytecode = Config::get('cms.forceBytecodeInvalidation', false);
  
          $options = [
              'auto_reload' => true,
              'debug' => $isDebugMode,
              'strict_variables' => $strictVariables,
          ];
  
          if ($useCache) {
              $options['cache'] = new Twig_Cache_Filesystem(
                  storage_path().'/cms/twig',
                  $forceBytecode ? Twig_Cache_Filesystem::FORCE_BYTECODE_INVALIDATION : 0
              );
          }
  
          $this->twig = new Twig_Environment($this->loader, $options);
          $this->twig->addExtension(new CmsTwigExtension($this));
          $this->twig->addExtension(new SystemTwigExtension);
  
          if ($isDebugMode) {
              $this->twig->addExtension(new DebugExtension($this));
          }
      }
code: protected function initTwigEnvironment()
      {
          $this->loader = new TwigLoader;
  
          $useCache = !Config::get('cms.twigNoCache');
          $isDebugMode = Config::get('app.debug', false);
          $strictVariables = Config::get('cms.enableTwigStrictVariables', false);
          $strictVariables = $strictVariables ?? $isDebugMode;
          $forceBytecode = Config::get('cms.forceBytecodeInvalidation', false);
  
          $options = [
              'auto_reload' => true,
              'debug' => $isDebugMode,
              'strict_variables' => $strictVariables,
          ];
  
          if ($useCache) {
              $options['cache'] = new Twig_Cache_Filesystem(
                  storage_path().'/cms/twig',
                  $forceBytecode ? Twig_Cache_Filesystem::FORCE_BYTECODE_INVALIDATION : 0
              );
          }
  
          $this->twig = new Twig_Environment($this->loader, $options);
          $this->twig->addExtension(new CmsTwigExtension($this));
          $this->twig->addExtension(new SystemTwigExtension);
  
          if ($isDebugMode) {
              $this->twig->addExtension(new DebugExtension($this));
          }
      }
code_tokens: protected function initTwigEnvironment ( ) { $ this -> loader = new TwigLoader ; $ useCache = ! Config :: get ( 'cms.twigNoCache' ) ; $ isDebugMode = Config :: get ( 'app.debug' , false ) ; $ strictVariables = Config :: get ( 'cms.enableTwigStrictVariables' , false ) ; $ strictVariables = $ strictVariables ?? $ isDebugMode ; $ forceBytecode = Config :: get ( 'cms.forceBytecodeInvalidation' , false ) ; $ options = [ 'auto_reload' => true , 'debug' => $ isDebugMode , 'strict_variables' => $ strictVariables , ] ; if ( $ useCache ) { $ options [ 'cache' ] = new Twig_Cache_Filesystem ( storage_path ( ) . '/cms/twig' , $ forceBytecode ? Twig_Cache_Filesystem :: FORCE_BYTECODE_INVALIDATION : 0 ) ; } $ this -> twig = new Twig_Environment ( $ this -> loader , $ options ) ; $ this -> twig -> addExtension ( new CmsTwigExtension ( $ this ) ) ; $ this -> twig -> addExtension ( new SystemTwigExtension ) ; if ( $ isDebugMode ) { $ this -> twig -> addExtension ( new DebugExtension ( $ this ) ) ; } }
docstring: Initializes the Twig environment and loader.
  Registers the \Cms\Twig\Extension object with Twig.
  @return void
docstring_tokens: Initializes the Twig environment and loader . Registers the \ Cms \ Twig \ Extension object with Twig .