@@ -67,15 +67,15 @@ discard block |
||
| 67 | 67 | 'client' => 'gtx', |
| 68 | 68 | 'hl' => 'en', |
| 69 | 69 | 'dt' => [ |
| 70 | - 't', // Translate |
|
| 71 | - 'bd', // Full translate with synonym ($bodyArray[1]) |
|
| 72 | - 'at', // Other translate ($bodyArray[5] - in google translate page this shows when click on translated word) |
|
| 73 | - 'ex', // Example part ($bodyArray[13]) |
|
| 74 | - 'ld', // I don't know ($bodyArray[8]) |
|
| 75 | - 'md', // Definition part with example ($bodyArray[12]) |
|
| 70 | + 't', // Translate |
|
| 71 | + 'bd', // Full translate with synonym ($bodyArray[1]) |
|
| 72 | + 'at', // Other translate ($bodyArray[5] - in google translate page this shows when click on translated word) |
|
| 73 | + 'ex', // Example part ($bodyArray[13]) |
|
| 74 | + 'ld', // I don't know ($bodyArray[8]) |
|
| 75 | + 'md', // Definition part with example ($bodyArray[12]) |
|
| 76 | 76 | 'qca', // I don't know ($bodyArray[8]) |
| 77 | - 'rw', // Read also part ($bodyArray[14]) |
|
| 78 | - 'rm', // I don't know |
|
| 77 | + 'rw', // Read also part ($bodyArray[14]) |
|
| 78 | + 'rm', // I don't know |
|
| 79 | 79 | 'ss' // Full synonym ($bodyArray[11]) |
| 80 | 80 | ], |
| 81 | 81 | 'sl' => null, // Source language |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | ?string $source = null, |
| 125 | 125 | array $options = [], |
| 126 | 126 | ?TokenProviderInterface $tokenProvider = null, |
| 127 | - bool|string $preserveParameters = false |
|
| 127 | + bool | string $preserveParameters = false |
|
| 128 | 128 | ) |
| 129 | 129 | { |
| 130 | 130 | $this->client = new Client(); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | ?string $source = null, |
| 239 | 239 | array $options = [], |
| 240 | 240 | ?TokenProviderInterface $tokenProvider = null, |
| 241 | - bool|string $preserveParameters = false |
|
| 241 | + bool | string $preserveParameters = false |
|
| 242 | 242 | ): ?string |
| 243 | 243 | { |
| 244 | 244 | return (new self) |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | if (is_string($responseArray)) { |
| 312 | 312 | $output = $responseArray; |
| 313 | 313 | } elseif (is_array($responseArray[0])) { |
| 314 | - $output = (string) array_reduce($responseArray[0], static function ($carry, $item) { |
|
| 314 | + $output = (string) array_reduce($responseArray[0], static function($carry, $item) { |
|
| 315 | 315 | $carry .= $item[0]; |
| 316 | 316 | return $carry; |
| 317 | 317 | }); |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | * @param bool|string $pattern Boolean or custom regex pattern to match parameters |
| 332 | 332 | * @return self |
| 333 | 333 | */ |
| 334 | - public function preserveParameters(bool|string $pattern = true): self |
|
| 334 | + public function preserveParameters(bool | string $pattern = true): self |
|
| 335 | 335 | { |
| 336 | 336 | if ($pattern === true) { |
| 337 | 337 | $this->pattern = '/:(\w+)/'; // Default regex |
@@ -360,10 +360,10 @@ discard block |
||
| 360 | 360 | // Replace all matches of our pattern with #{\d} for replacement later |
| 361 | 361 | return preg_replace_callback( |
| 362 | 362 | pattern: $this->pattern, |
| 363 | - callback: static function ($matches) { |
|
| 363 | + callback: static function($matches) { |
|
| 364 | 364 | static $index = 0; |
| 365 | 365 | |
| 366 | - return '#{' . $index++ . '}'; |
|
| 366 | + return '#{'.$index++.'}'; |
|
| 367 | 367 | }, |
| 368 | 368 | subject: $string |
| 369 | 369 | ); |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | { |
| 516 | 516 | $menu = 'sl'; // 'tl'; |
| 517 | 517 | $url = parse_url($this->url); |
| 518 | - $url = $url['scheme'] . '://' . $url['host'] . '/m?' . http_build_query(['mui' => $menu, 'hl' => $target]); |
|
| 518 | + $url = $url['scheme'].'://'.$url['host'].'/m?'.http_build_query(['mui' => $menu, 'hl' => $target]); |
|
| 519 | 519 | |
| 520 | 520 | try { |
| 521 | 521 | $response = $this->client->get($url, $this->options); |