returns the instance.

@return Parser
766057
public static final Parser<Date> instance() { // NOPMD it's thread save!
    if (DateTimeLocalParser.instanceParser == null) {
      synchronized (DateTimeLocalParser.class) {
        if (DateTimeLocalParser.instanceParser == null) {
          DateTimeLocalParser.instanceParser = new DateTimeLocalParser("yyyy-MM-dd'T'HH:mm:ss");
        }
      }
    }
    return DateTimeLocalParser.instanceParser;
  }
347556
public function getParserClass()
    {
        $server = RequestContext::getServer();
        if($server instanceof \Imi\Server\WebSocket\Server)
        {
            return ConnectContext::get('httpRouteResult')['wsConfig']->parserClass ?? JsonObjectParser::class;
        }
        else if($server instanceof \Imi\Server\TcpServer\Server || $server instanceof \Imi\Server\UdpServer\Server)
        {
            return $server->getConfig()['dataParser'] ?? JsonObjectParser::class;
        }
        else
        {
            return JsonObjectParser::class;
        }
    }
308283
public function getParser()
    {
        if (!$this->parser) {
            $this->parser = new \Phergie\Irc\Parser();
        }
        return $this->parser;
    }
604444
public function getParser()
    {
        $parser = new QueryParser();
        $parser->addResolvers([
            new Resolvers\ValueResolver(),
            new Resolvers\KeyResolver(),
            new Resolvers\GroupingResolver(),
            new Resolvers\SumFunctionResolver(),
            new Resolvers\DateFormatFunctionResolver(),
            new Resolvers\ConcatFunctionResolver(),
            new Resolvers\NotEqResolver(),
            new Resolvers\EqResolver(),
            new Resolvers\LteResolver(),
            new Resolvers\LtResolver(),
            new Resolvers\GteResolver(),
            new Resolvers\GtResolver(),
            new Resolvers\CtResolver(),
            new Resolvers\SwResolver(),
            new Resolvers\EwResolver(),
            new Resolvers\NotInResolver(),
            new Resolvers\InResolver(),
            new Resolvers\NotNullResolver(),
            new Resolvers\NullResolver(),
            new Resolvers\AndResolver(),
            new Resolvers\OrResolver(),
        ]);

        return $parser;
    }
699212
public function instance()
	{
		try
		{
			$editor = App::get('editor');
		}
		catch (Exception $e)
		{
			$editor = \Hubzero\Html\Editor::getInstance('none');
		}

		return $editor;
	}
806257
public static function getInstance()
    {
        if (!isset(self::$_instance)) {
            $c = __CLASS__;
            self::$_instance = new $c;
        }
        return self::$_instance;
    }
109975
public static function getInstance()
    {
        if (true === is_null(self::$_instance)) {
            self::$_instance = new self();
            self::$_instance->variables = [];
            self::$_instance->system_errors = [];
            self::$_instance->system_debug = [];
            self::$_instance->variables["config"] = [];
        }

        return self::$_instance;
    }
1241509
public static function fromParser(Parser\Search\AnimeSearchParser $parser): self
    {
        $instance = new self();

        $instance->results = $parser->getResults();
        $instance->lastPage = $parser->getLastPage();

        return $instance;
    }
619478
public static function parser()
	{
		if ( ! empty(static::$_parser))
		{
			return static::$_parser;
		}

		$options = array(
			// TODO: set 'logger' with Monolog instance.
			'cache'   => \Config::get('parser.View_Mustache.environment.cache_dir', APPPATH.'cache'.DS.'mustache'.DS),
			'charset' => \Config::get('parser.View_Mustache.environment.charset', 'UTF-8'),
		);

		if ($partials = \Config::get('parser.View_Mustache.environment.partials', array())) {
			$options['partials'] = $partials;
		}

		if ($helpers = \Config::get('parser.View_Mustache.environment.helpers', array())) {
			$options['helpers'] = $helpers;
		}

		static::$_parser = new Mustache_Engine($options);

		return static::$_parser;
	}
1066692
public static function parser()
	{
		if ( ! empty(static::$_parser))
		{
			return static::$_parser;
		}

		// Parser
		static::$_parser = new Dwoo();
		static::$_parser->setCacheTime(\Config::get('parser.View_Dwoo.environment.cache_time', 0));
		static::$_parser->setCacheDir(\Config::get('parser.View_Dwoo.environment.cache_dir', APPPATH.'cache'.DS.'dwoo'.DS));
		static::$_parser->setCompileDir(\Config::get('parser.View_Dwoo.environment.compile_dir', APPPATH.'cache'.DS.'dwoo'.DS.'compiled'.DS));

		// Compiler
		static::$_parser_compiler = new Dwoo_Compiler;
		static::$_parser_compiler->setAutoEscape(\Config::get('parser.View_Dwoo.environment.autoescape', false));
		static::$_parser_compiler->setLooseOpeningHandling(\Config::get('parser.View_Dwoo.environment.allow_spaces', false));
		static::$_parser_compiler->setNestedCommentsHandling(\Config::get('parser.View_Dwoo.environment.nested_comments', false));
		static::$_parser_compiler->setDelimiters(
			\Config::get('parser.View_Dwoo.delimiters.left', '{'),
			\Config::get('parser.View_Dwoo.delimiters.right', '}')
		);

		// Security
		static::$_parser_security = new Dwoo_Security_Policy;
		static::$_parser_security->setPhpHandling(\Config::get('parser.View_Dwoo.environment.allow_php_tags', 2));
		static::$_parser_security->allowPhpFunction(\Config::get('parser.View_Dwoo.environment.allow_php_func', array()));

		static::$_parser->setSecurityPolicy(static::$_parser_security);

		return static::$_parser;
	}
11137
private static function getInstance()
    {
        if (self::$converter === null) {
            self::$converter = new AnsiToHtmlConverter(null, false);
        }

        return self::$converter;
    }
39612
public static function __instance()
        {
            if (empty(self::$__instance)) {
                self::$__instance = with(new \ReflectionClass(self::$__class))->newInstanceArgs(self::$__args);
            }

            return self::$__instance;
        }
739786
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                MatcherVerifier::instance(),
                InlineExporter::instance(),
                DifferenceEngine::instance(),
                FeatureDetector::instance()
            );
        }

        return self::$instance;
    }
1373535
public static function instance()
    {
        if ( !isset( self::$instance ) )
        {
            $ini = eZINI::instance( 'ezcomments.ini' );
            $className = $ini->variable( 'ManagerClasses', 'CommentManagerClass' );
            self::$instance = new $className();
        }
        return self::$instance;
    }
1257397
private static function instance()
    {
        $currentClass = get_called_class();
        $instanceName = empty( self::$instance ) ? '' : new \ReflectionClass(self::$instance);
        if( empty( self::$instance ) || ( $instanceName->name != $currentClass ) ) {
            self::$instance = new static();
        }
        return self::$instance;
    }
321320
public static function instance()
	{
		if ( ! isset( self::$logger ) ) {
			self::$logger = new Logger( self::$path );
		}
		return self::$logger;
	}
1161919
public static function GetInstance() {
      if (!isset(self::$_Instance)) {
         $c = __CLASS__;
         self::$_Instance = new $c();
      }
      return self::$_Instance;
   }