@@ -65,15 +65,15 @@ discard block |
||
65 | 65 | 'client' => 'gtx', |
66 | 66 | 'hl' => 'en', |
67 | 67 | 'dt' => [ |
68 | - 't', // Translate |
|
69 | - 'bd', // Full translate with synonym ($bodyArray[1]) |
|
70 | - 'at', // Other translate ($bodyArray[5] - in google translate page this shows when click on translated word) |
|
71 | - 'ex', // Example part ($bodyArray[13]) |
|
72 | - 'ld', // I don't know ($bodyArray[8]) |
|
73 | - 'md', // Definition part with example ($bodyArray[12]) |
|
68 | + 't', // Translate |
|
69 | + 'bd', // Full translate with synonym ($bodyArray[1]) |
|
70 | + 'at', // Other translate ($bodyArray[5] - in google translate page this shows when click on translated word) |
|
71 | + 'ex', // Example part ($bodyArray[13]) |
|
72 | + 'ld', // I don't know ($bodyArray[8]) |
|
73 | + 'md', // Definition part with example ($bodyArray[12]) |
|
74 | 74 | 'qca', // I don't know ($bodyArray[8]) |
75 | - 'rw', // Read also part ($bodyArray[14]) |
|
76 | - 'rm', // I don't know |
|
75 | + 'rw', // Read also part ($bodyArray[14]) |
|
76 | + 'rm', // I don't know |
|
77 | 77 | 'ss' // Full synonym ($bodyArray[11]) |
78 | 78 | ], |
79 | 79 | 'sl' => null, // Source language |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | ?string $source = null, |
123 | 123 | array $options = [], |
124 | 124 | ?TokenProviderInterface $tokenProvider = null, |
125 | - bool|string $preserveParameters = false |
|
125 | + bool | string $preserveParameters = false |
|
126 | 126 | ) |
127 | 127 | { |
128 | 128 | $this->client = new Client(); |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | ?string $source = null, |
237 | 237 | array $options = [], |
238 | 238 | ?TokenProviderInterface $tokenProvider = null, |
239 | - bool|string $preserveParameters = false |
|
239 | + bool | string $preserveParameters = false |
|
240 | 240 | ): ?string |
241 | 241 | { |
242 | 242 | return (new self) |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | if (is_string($responseArray)) { |
310 | 310 | $output = $responseArray; |
311 | 311 | } elseif (is_array($responseArray[0])) { |
312 | - $output = (string) array_reduce($responseArray[0], static function ($carry, $item) { |
|
312 | + $output = (string) array_reduce($responseArray[0], static function($carry, $item) { |
|
313 | 313 | $carry .= $item[0]; |
314 | 314 | return $carry; |
315 | 315 | }); |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | * @param bool|string $pattern Boolean or custom regex pattern to match parameters |
330 | 330 | * @return self |
331 | 331 | */ |
332 | - public function preserveParameters(bool|string $pattern = true): self |
|
332 | + public function preserveParameters(bool | string $pattern = true): self |
|
333 | 333 | { |
334 | 334 | if ($pattern === true) { |
335 | 335 | $this->pattern = '/:(\w+)/'; // Default regex |
@@ -358,12 +358,12 @@ discard block |
||
358 | 358 | // Replace all matches of our pattern with #{\d} for replacement later |
359 | 359 | return preg_replace_callback( |
360 | 360 | $this->pattern, |
361 | - function ($matches) { |
|
361 | + function($matches) { |
|
362 | 362 | static $index = -1; |
363 | 363 | |
364 | 364 | $index++; |
365 | 365 | |
366 | - return '#{' . $index . '}'; |
|
366 | + return '#{'.$index.'}'; |
|
367 | 367 | }, |
368 | 368 | $string |
369 | 369 | ); |