@@ -46,9 +46,9 @@ |
||
| 46 | 46 | if($header === null) { |
| 47 | 47 | return null; |
| 48 | 48 | } |
| 49 | - $s = strtolower($header); // case insensitive |
|
| 50 | - $s = strtr($s, '_', '-'); // cs_CZ means cs-CZ |
|
| 51 | - rsort($langs); // first more specific |
|
| 49 | + $s = strtolower($header); // case insensitive |
|
| 50 | + $s = strtr($s, '_', '-'); // cs_CZ means cs-CZ |
|
| 51 | + rsort($langs); // first more specific |
|
| 52 | 52 | $pattern = ')(?:-[^\s,;=]+)?\s*(?:;\s*q=([0-9.]+))?#'; |
| 53 | 53 | preg_match_all('#(' . implode('|', $langs) . $pattern, $s, $matches); |
| 54 | 54 | if(!isset($matches[0])) { |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | declare(strict_types=1); |
| 3 | 3 | |
| 4 | 4 | require __DIR__ . "/../vendor/autoload.php"; |
| 5 | -Testbench\Bootstrap::setup(__DIR__ . '/_temp', function (\Nette\Configurator $configurator): void { |
|
| 5 | +Testbench\Bootstrap::setup(__DIR__ . '/_temp', function(\Nette\Configurator $configurator): void { |
|
| 6 | 6 | $configurator->addStaticParameters([ |
| 7 | 7 | "appDir" => __DIR__, |
| 8 | 8 | "tempDir" => __DIR__ . "/_temp", |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | $originalLoader = $this->getContainer() |
| 307 | 307 | ->getService("translation.originalLoader"); |
| 308 | 308 | Assert::type(NeonLoader::class, $originalLoader); |
| 309 | - $compiler = $this->getService(CatalogueCompiler::class); |
|
| 309 | + $compiler = $this->getService(CatalogueCompiler::class); |
|
| 310 | 310 | Assert::type(CatalogueCompiler::class, $compiler); |
| 311 | 311 | /** @var Translator $translator */ |
| 312 | 312 | $translator = $this->getService(\Nette\Localization\Translator::class); |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | $originalLoader = $this->getContainer() |
| 353 | 353 | ->getService("translation.originalLoader"); |
| 354 | 354 | Assert::type(NeonLoader::class, $originalLoader); |
| 355 | - $compiler = $this->getService(CatalogueCompiler::class); |
|
| 355 | + $compiler = $this->getService(CatalogueCompiler::class); |
|
| 356 | 356 | Assert::type(CatalogueCompiler::class, $compiler); |
| 357 | 357 | /** @var Translator $translator */ |
| 358 | 358 | $translator = $this->getService(\Nette\Localization\Translator::class); |
@@ -26,15 +26,15 @@ |
||
| 26 | 26 | |
| 27 | 27 | public function __construct(private readonly Loader $loader, private readonly IMessageSelector $messageSelector = new MessageSelector()) { |
| 28 | 28 | } |
| 29 | - /** |
|
| 30 | - * @deprecated Access the property directly |
|
| 31 | - */ |
|
| 29 | + /** |
|
| 30 | + * @deprecated Access the property directly |
|
| 31 | + */ |
|
| 32 | 32 | public function getLang(): string { |
| 33 | 33 | return $this->loader->getLang(); |
| 34 | 34 | } |
| 35 | - /** |
|
| 36 | - * @deprecated Access the property directly |
|
| 37 | - */ |
|
| 35 | + /** |
|
| 36 | + * @deprecated Access the property directly |
|
| 37 | + */ |
|
| 38 | 38 | public function setLang(string $lang): void { |
| 39 | 39 | $this->loader->setLang($lang); |
| 40 | 40 | } |