system/Config/Services.php
public static function parser(string $viewPath = null, $config = null, bool $getShared = true)
	{
		if ($getShared)
		{
			return static::getSharedInstance('parser', $viewPath, $config);
		}

		if (is_null($config))
		{
			$config = new \Config\View();
		}

		if (is_null($viewPath))
		{
			$paths    = config('Paths');
			$viewPath = $paths->viewDirectory;
		}

		return new Parser($config, $viewPath, static::locator(true), CI_DEBUG, static::logger(true));
	}
public static function parser(string $viewPath = null, $config = null, bool $getShared = true)
	{
		if ($getShared)
		{
			return static::getSharedInstance('parser', $viewPath, $config);
		}

		if (is_null($config))
		{
			$config = new \Config\View();
		}

		if (is_null($viewPath))
		{
			$paths    = config('Paths');
			$viewPath = $paths->viewDirectory;
		}

		return new Parser($config, $viewPath, static::locator(true), CI_DEBUG, static::logger(true));
	}
The Parser is a simple template parser.

@param string  $viewPath
@param mixed   $config
@param boolean $getShared

@return \CodeIgniter\View\Parser