@@ -245,12 +245,12 @@ |
||
245 | 245 | * This can be called from instance method translate() using __call() magic method. |
246 | 246 | * Use $instance->translate($string) instead. |
247 | 247 | * |
248 | - * @param string $data Text or array of texts to translate |
|
249 | 248 | * |
250 | 249 | * @throws InvalidArgumentException If the provided argument is not of type 'string' |
251 | 250 | * @throws ErrorException If the HTTP request fails |
252 | 251 | * @throws UnexpectedValueException If received data cannot be decoded |
253 | 252 | * |
253 | + * @param string $string |
|
254 | 254 | * @return string|bool Translated text |
255 | 255 | */ |
256 | 256 | protected function translateText($string) |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | } |
313 | 313 | |
314 | 314 | if (is_array($responseArray[0])) { |
315 | - return array_reduce($responseArray[0], function ($carry, $item) { |
|
315 | + return array_reduce($responseArray[0], function($carry, $item) { |
|
316 | 316 | $carry .= $item[0]; |
317 | 317 | |
318 | 318 | return $carry; |
@@ -341,6 +341,6 @@ discard block |
||
341 | 341 | */ |
342 | 342 | public function isValidLocale($lang) |
343 | 343 | { |
344 | - return (bool)preg_match('/^([a-z]{2})(-[A-Z]{2})?$/', $lang); |
|
344 | + return (bool) preg_match('/^([a-z]{2})(-[A-Z]{2})?$/', $lang); |
|
345 | 345 | } |
346 | 346 | } |
@@ -115,10 +115,10 @@ |
||
115 | 115 | throw new BadMethodCallException("Method [{$methodName}] does not exist"); |
116 | 116 | } |
117 | 117 | |
118 | - $reflectionMethod = new \ReflectionMethod (self::getInstance(), $methodName); |
|
118 | + $reflectionMethod = new \ReflectionMethod(self::getInstance(), $methodName); |
|
119 | 119 | $minimumArgs = $reflectionMethod->getNumberOfRequiredParameters(); |
120 | 120 | if (count($args) < $minimumArgs) { |
121 | - throw new InvalidArgumentException("Expecting $minimumArgs parameter" . ($minimumArgs == 1 ? '' : 's')); |
|
121 | + throw new InvalidArgumentException("Expecting $minimumArgs parameter".($minimumArgs == 1 ? '' : 's')); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | return call_user_func_array([self::getInstance(), $methodName], $args); |