Returns the Symfony YAML parser

This method triggers the `onYamlParserRegistered` event when the Symfony
YAML parser wasn't initiated yet.

@return \Symfony\Component\Yaml\Parser Symfony YAML parser
513224
public function getYamlParser()
    {
        if ($this->yamlParser === null) {
            $this->yamlParser = new \Symfony\Component\Yaml\Parser();
            $this->triggerEvent('onYamlParserRegistered', array(&$this->yamlParser));
        }

        return $this->yamlParser;
    }
542187
private function getParser()
    {
        if (null === $this->parser) {
            $this->parser = new Parser;
            $this->fixUniqueHeaders();
            $this->parser->setText($this->toString());
        }
        return $this->parser;
    }
444714
public function getOptionParser()
    {
        list($root, $name) = explode(' ', $this->name, 2);
        $parser = new ConsoleOptionParser($name);
        $parser->setRootName($root);

        $parser = $this->buildOptionParser($parser);
        if (!($parser instanceof ConsoleOptionParser)) {
            throw new RuntimeException(sprintf(
                "Invalid option parser returned from buildOptionParser(). Expected %s, got %s",
                ConsoleOptionParser::class,
                getTypeName($parser)
            ));
        }

        return $parser;
    }
33286
final public function getDynamicItemsParserHandler()
    {
        $chunks = explode('\\', get_class($this));

        return \C5TL\Parser::handlifyString(end($chunks));
    }
817303
public function toYaml($data = null)
	{
		if ($data == null)
		{
			$data = $this->data;
		}

		if ( ! class_exists('Symfony\Component\Yaml\Yaml'))
		{
			// @codeCoverageIgnoreStart
			throw new \RuntimeException('You need to install the "symfony/yaml" composer package to use Format::toYaml()');
			// @codeCoverageIgnoreEnd
		}

		$parser = new \Symfony\Component\Yaml\Yaml();
		return $parser::dump($data);
	}
1002442
public function getOptionParser() {
		$parser = parent::getOptionParser();
		$parser->addArgument('name(s)', array(
			'required' => true,
			'help' => 'Enter one or more cache/view names separated by comma or "all"' .
			"\n<comment>(choises: " . implode(',', array_merge(Cache::configured(), array('all'))) . ")</comment>"
		));
		$parser->addOption('views', array(
			'boolean' => true,
			'help' => 'If set views files will be deleted' .
			"\n<comment>(choises: " . implode(',', array('view_file_name*', 'all')) . ")</comment>"
		));
		return $parser->description('Clear cache');
	}
1176598
public function getTwig()
    {
        if (!$this->twig) {
            Twig_Autoloader::register();
            $this->twig_loader = new Twig_Loader_Filesystem($this->base_view_path);

            $this->twig = new Twig_Environment(
                $this->twig_loader,
                $this->loader_configs
            );
        }

        return $this->twig;
    }
295619
public function getOptionParser(): ConsoleOptionParser
    {
        return parent::getOptionParser()->addSubcommand(
            'all',
            [
                'short' => 'a',
                'help' => __('Searches and precompiles all twig templates it finds.'),
            ]
        )->addSubcommand(
            'plugin',
            [
                'short' => 'p',
                'help' => __('Searches and precompiles all twig templates for a specific plugin.'),
            ]
        )->addSubcommand(
            'file',
            [
                'short' => 'f',
                'help' => __('Precompile a specific file.'),
            ]
        )->setDescription(__('TwigView templates precompiler'));
    }
1164131
public function getOptionParser()
    {
        $parser = parent::getOptionParser();

        $parser->setDescription(
            'Get the list of available shells for this CakePHP application.'
        )->addOption('xml', [
            'help' => 'Get the listing as XML.',
            'boolean' => true
        ])->addOption('version', [
            'help' => 'Prints the currently installed version of CakePHP. (deprecated - use `cake --version` instead)',
            'boolean' => true
        ]);

        return $parser;
    }
172637
public function getOptionParser()
    {
        $parser = parent::getOptionParser();
        $parser
            ->description(__d('eav', 'Select target table'))
            ->addOption('use', [
                'short' => 'u',
                'help' => __d('eav', 'The table alias name. e.g. "User.Users".'),
            ])
            ->addOption('bundle', [
                'short' => 'b',
                'help' => __d('eav', 'Indicates the column belongs to a bundle name within the table.'),
                'default' => null,
            ]);

        return $parser;
    }
545371
public function buildParserConfiguration()
    {
        if ($this->parserConfiguration === null) {
            $this->parserConfiguration = parent::buildParserConfiguration();
            $this->parserConfiguration->addInterceptor(new ResourceInterceptor());
        }

        return $this->parserConfiguration;
    }
1325437
public function getOptionParser()
    {
        $parser = parent::getOptionParser();

        $parser->addSubcommand('initialize', [
            'help' => 'Execute The Initialize-method. This will add some important data to your database.',
            'parser' => $this->Initialize->getOptionParser(),
        ]);
        $parser->addSubcommand('user', [
            'help' => 'Execute The User-task. You will be able to create an user.',
            'parser' => $this->User->getOptionParser(),
        ]);

        return $parser;
    }
1099571
private function initAnnotationReader()
    {
        AnnotationRegistry::registerFile(
            $this->getVendorDir().'/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'
        );

        // annotations require custom autoloading
        AnnotationRegistry::registerAutoloadNamespaces([
            'JMS\Serializer\Annotation' => $this->getVendorDir().'/jms/serializer/src/',
        ]);

        AnnotationRegistry::registerLoader(function ($classname) {
            if (0 === strpos($classname, 'BackBee')) {
                return class_exists($classname);
            }

            if (0 === strpos($classname, 'Symfony\Component\Validator\Constraints')) {
                return class_exists($classname);
            }

            return false;
        });
    }
658018
public function getTwig()
	{
		
		if (!$this->twig)
		{
			$loader = new \Twig_Loader_Filesystem( $this->getTemplateDir().'/'.TWIG_TEMPLATES_PATH, getcwd() );
			
			if (file_exists($this->getTemplateDir().'/widgets'))
				$loader->addPath( $this->getTemplateDir().'/widgets' ,'widget' );
			
			foreach ($this->_widgetPaths as $p) $loader->addPath( $p ,'widget' );			
			$loader->addPath( CMSROOT.'/widgets' ,'widget' );
			
			foreach ($this->_widgetPaths as $p) $loader->addPath( $p ,'widget_distrib' );			
			$loader->addPath( CMSROOT.'/widgets' ,'widget_distrib' );			
			
			$options = array(
				'cache'       => TWIG_CACHE_DIR,
				'auto_reload' => true,
				'strict_variables' => true,
			);
			
			if ($this->debugMode) {
				$options['cache'] = false;
				$options['debug'] = true;
			}
			
			$this->twig = new \Twig_Environment($loader, $options);

			$this->twig->addTokenParser( new Twig\TokenParser\Widget() );
			$this->twig->addExtension( new \Twig_Extensions_Extension_Text() );	
			$this->twig->addExtension(new \Twig_Extensions_Extension_I18n());
			$this->twig->addExtension(new \Twig_Extension_Debug());

			$this->twig->addFunction(new \Twig_SimpleFunction('_', function($text) {
				return Application::getInstance()->getTranslator()->_($text);
			}));
			
			$this->twig->addFilter( new \Twig_SimpleFilter('phone', function($num) {
				
				return preg_replace('/[^\+^\d]/i','', $num);
				
			} ) );
			
			$this->twig->addGlobal('application', $this);
			$this->twig->addGlobal('t', $this->getTranslator());
			$this->twig->addGlobal('s',  $_SERVER);
			
		}
		
		return $this->twig;
		
	}
308283
public function getParser()
    {
        if (!$this->parser) {
            $this->parser = new \Phergie\Irc\Parser();
        }
        return $this->parser;
    }
398346
public function getOptionParser()
    {
        if (!defined('QUICKAPPS_CORE')) {
            return parent::getOptionParser();
        }

        $parser = parent::getOptionParser();
        $parser
            ->description(__d('cms', 'Get the list of available shells for this QuickAppsCMS installation.'))
            ->addOption('xml', [
                'help' => __d('cms', 'Get the listing as XML.'),
                'boolean' => true,
            ]);

        return $parser;
    }
550684
public static function getLicenseFile()

    {
        if (!isset(self::$file)) {
            $path = Grav::instance()['locator']->findResource('user-data://') . '/licenses.yaml';
            if (!file_exists($path)) {
                touch($path);
            }
            self::$file = CompiledYamlFile::instance($path);
        }

        return self::$file;
    }