final public static function getInstance()
    {
        $cls = static::class;
        if (isset(static::$instances[$cls])) {
            return static::$instances[$cls];
        }

        if ($cls === self::class) {
            throw new \LogicException("$cls cannot be used directly. Please subclass in your project.");
        }

        return static::$instances[$cls] = static::create();
    }
final public static function getInstance()
    {
        $cls = static::class;
        if (isset(static::$instances[$cls])) {
            return static::$instances[$cls];
        }

        if ($cls === self::class) {
            throw new \LogicException("$cls cannot be used directly. Please subclass in your project.");
        }

        return static::$instances[$cls] = static::create();
    }
final public static function getInstance ( ) { $ cls = static :: class ; if ( isset ( static :: $ instances [ $ cls ] ) ) { return static :: $ instances [ $ cls ] ; } if ( $ cls === self :: class ) { throw new \ LogicException ( "$cls cannot be used directly. Please subclass in your project." ) ; } return static :: $ instances [ $ cls ] = static :: create ( ) ; }
Return the singleton instance for the called class.

@return static
Return the singleton instance for the called class .