protected function injectConfig($src)
	{
		$config = array_map(
			[$this, 'encode'],
			$this->configOptimizer->optimize(
				[
					'plugins'        => $this->getPluginsConfig(),
					'registeredVars' => $this->getRegisteredVarsConfig(),
					'rootContext'    => $this->getRootContext(),
					'tagsConfig'     => $this->getTagsConfig()
				]
			)
		);

		$src = preg_replace_callback(
			'/(\\nvar (' . implode('|', array_keys($config)) . '))(;)/',
			function ($m) use ($config)
			{
				return $m[1] . '=' . $config[$m[2]] . $m[3];
			},
			$src
		);

		// Prepend the deduplicated objects
		$src = $this->configOptimizer->getVarDeclarations() . $src;

		return $src;
	}
protected function injectConfig($src)
	{
		$config = array_map(
			[$this, 'encode'],
			$this->configOptimizer->optimize(
				[
					'plugins'        => $this->getPluginsConfig(),
					'registeredVars' => $this->getRegisteredVarsConfig(),
					'rootContext'    => $this->getRootContext(),
					'tagsConfig'     => $this->getTagsConfig()
				]
			)
		);

		$src = preg_replace_callback(
			'/(\\nvar (' . implode('|', array_keys($config)) . '))(;)/',
			function ($m) use ($config)
			{
				return $m[1] . '=' . $config[$m[2]] . $m[3];
			},
			$src
		);

		// Prepend the deduplicated objects
		$src = $this->configOptimizer->getVarDeclarations() . $src;

		return $src;
	}
protected function injectConfig ( $ src ) { $ config = array_map ( [ $ this , 'encode' ] , $ this -> configOptimizer -> optimize ( [ 'plugins' => $ this -> getPluginsConfig ( ) , 'registeredVars' => $ this -> getRegisteredVarsConfig ( ) , 'rootContext' => $ this -> getRootContext ( ) , 'tagsConfig' => $ this -> getTagsConfig ( ) ] ) ) ; $ src = preg_replace_callback ( '/(\\nvar (' . implode ( '|' , array_keys ( $ config ) ) . '))(;)/' , function ( $ m ) use ( $ config ) { return $ m [ 1 ] . '=' . $ config [ $ m [ 2 ] ] . $ m [ 3 ] ; } , $ src ) ; // Prepend the deduplicated objects $ src = $ this -> configOptimizer -> getVarDeclarations ( ) . $ src ; return $ src ; }
Inject the parser config into given source

@param  string $src Parser's source
@return string      Modified source
Inject the parser config into given source