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");
}
}