original_string: private function getSymfonyContainer()
      {
          // 1. Preferred way in contao 4.0+
          if (method_exists('Contao\System', 'getContainer')
              && ($container = System::getContainer()) instanceof ContainerInterface
          ) {
              return $container;
          }
  
          // 2. Fallback to fetch from kernel.
          if (isset($GLOBALS['kernel'])
              && $GLOBALS['kernel'] instanceof KernelInterface
              && ($container = $GLOBALS['kernel']->getContainer()) instanceof ContainerInterface
          ) {
              return $container;
          }
  
          // 3. Nothing worked out, throw Exception as this may never happen.
          throw new \RuntimeException('Could not obtain symfony container.');
      }
code: private function getSymfonyContainer()
      {
          // 1. Preferred way in contao 4.0+
          if (method_exists('Contao\System', 'getContainer')
              && ($container = System::getContainer()) instanceof ContainerInterface
          ) {
              return $container;
          }
  
          // 2. Fallback to fetch from kernel.
          if (isset($GLOBALS['kernel'])
              && $GLOBALS['kernel'] instanceof KernelInterface
              && ($container = $GLOBALS['kernel']->getContainer()) instanceof ContainerInterface
          ) {
              return $container;
          }
  
          // 3. Nothing worked out, throw Exception as this may never happen.
          throw new \RuntimeException('Could not obtain symfony container.');
      }
code_tokens: private function getSymfonyContainer ( ) { // 1. Preferred way in contao 4.0+ if ( method_exists ( 'Contao\System' , 'getContainer' ) && ( $ container = System :: getContainer ( ) ) instanceof ContainerInterface ) { return $ container ; } // 2. Fallback to fetch from kernel. if ( isset ( $ GLOBALS [ 'kernel' ] ) && $ GLOBALS [ 'kernel' ] instanceof KernelInterface && ( $ container = $ GLOBALS [ 'kernel' ] -> getContainer ( ) ) instanceof ContainerInterface ) { return $ container ; } // 3. Nothing worked out, throw Exception as this may never happen. throw new \ RuntimeException ( 'Could not obtain symfony container.' ) ; }
docstring: Determine the symfony container.
  
  @return ContainerInterface|null
  
  @throws \RuntimeException When the container can not be obtained.
  
  @SuppressWarnings(PHPMD.Superglobals)
  @SuppressWarnings(PHPMD.CamelCaseVariableName)
docstring_tokens: Determine the symfony container .