| 1234567891011121314151617181920212223242526272829303132333435363738394041 | <?phpnamespace App\libs\wechat\auth;use Prophecy\Exception\Doubler\ClassNotFoundException;/** * @desc * @method  static \swdz\wechat\auth\Gateways\General     General * @method  static \swdz\wechat\auth\Gateways\Mini        Mini * @package lc\wechat\auth */class WeChat{    /**     * @param $method     * @return mixed     */    private static function make($method)    {        $value = ucwords(str_replace(['-', '_'], ' ', $method));        $gateway = __NAMESPACE__ . '\\Gateways\\' . $value;        if (class_exists($gateway)) {            return new $gateway();        }        throw new ClassNotFoundException("Gateway [{$method}] Not Exists",$gateway);    }    /**     * @desc     * @param   string  $method     * @param   array   $arguments     * @return  mixed     */    public static function __callStatic($method, $arguments)    {        return self::make($method, ...$arguments);    }}
 |