Code Duplication    Length = 12-12 lines in 2 locations

src/Gateways/Alipay/Support.php 1 location

@@ 102-113 (lines=12) @@
99
     *
100
     * @return self
101
     */
102
    public static function getInstance($config = null): self
103
    {
104
        if ((!(self::$instance instanceof self)) && is_null($config)) {
105
            throw new InvalidArgumentException('Must Initialize Support With Config Before Using');
106
        }
107
108
        if (!(self::$instance instanceof self)) {
109
            self::$instance = new self($config);
110
        }
111
112
        return self::$instance;
113
    }
114
115
    /**
116
     * Get Alipay API result.

src/Gateways/Wechat/Support.php 1 location

@@ 110-121 (lines=12) @@
107
     *
108
     * @return self
109
     */
110
    public static function getInstance($config = null): self
111
    {
112
        if ((!(self::$instance instanceof self)) && is_null($config)) {
113
            throw new InvalidArgumentException('Must Initialize Support With Config Before Using');
114
        }
115
116
        if (!(self::$instance instanceof self)) {
117
            self::$instance = new self($config);
118
        }
119
120
        return self::$instance;
121
    }
122
123
    /**
124
     * Request wechat api.