1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\libs\google;
- use Symfony\Component\VarExporter\Exception\ClassNotFoundException;
- /**
- * @desc
- * @method static \App\libs\google\Gateways\GoogleOauth GoogleOauth
- * @package \App\libs\google
- */
- class Google
- {
- /**
- * @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);
- }
- }
|