Stichoza\GoogleTranslate\TranslateClient::__callStatic PHP Метод

__callStatic() публичный статический Метод

Override translate method for static call.
public static __callStatic ( $name, $args )
    public static function __callStatic($name, $args)
    {
        switch ($name) {
            case 'translate':
                if (count($args) < 3) {
                    throw new InvalidArgumentException('Expecting 3 parameters');
                }
                try {
                    $result = self::staticTranslate($args[0], $args[1], $args[2]);
                } catch (Exception $e) {
                    throw $e;
                }
                return $result;
            case 'getLastDetectedSource':
                return self::staticGetLastDetectedSource();
            default:
                throw new BadMethodCallException("Method [{$name}] does not exist");
        }
    }