diff --git a/.github/workflows/coding-style.yml b/.github/workflows/coding-style.yml index 50d857d..a7479ad 100644 --- a/.github/workflows/coding-style.yml +++ b/.github/workflows/coding-style.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v2 - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.1 coverage: none - run: composer create-project nette/code-checker temp/code-checker ^3 --no-progress @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v2 - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.1 coverage: none - run: composer create-project nette/coding-standard temp/coding-standard ^3 --no-progress diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index f985b05..2b3ee95 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v2 - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.1 coverage: none - run: composer install --no-progress --prefer-dist diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 73fdcc9..3021e74 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['8.0'] + php: ['8.1'] fail-fast: false diff --git a/composer.json b/composer.json index d001c26..614d40d 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=8.0", + "php": ">=8.1", "nette/di": "^3.0", "nette/utils": "^3.1", "nette/application": "^3.0" diff --git a/src/Drago/Localization/Translator.php b/src/Drago/Localization/Translator.php index 26068b8..f12796c 100644 --- a/src/Drago/Localization/Translator.php +++ b/src/Drago/Localization/Translator.php @@ -10,6 +10,7 @@ namespace Drago\Localization; use Nette; +use Nette\Neon\Exception; use Nette\Neon\Neon; @@ -29,6 +30,9 @@ public function __construct( } + /** + * @throws Exception + */ private function decodeFile(string $file): array { $arr = []; @@ -39,6 +43,9 @@ private function decodeFile(string $file): array } + /** + * @throws Exception + */ public function setTranslate(string $translate): array { $file = $this->translateDir . '/' . $translate . '.neon'; @@ -47,6 +54,9 @@ public function setTranslate(string $translate): array } + /** + * @throws Exception + */ public function setCustomTranslate(string $path, string $translate): array { $file = $path . $translate . '.neon'; diff --git a/src/Drago/Localization/TranslatorAdapter.php b/src/Drago/Localization/TranslatorAdapter.php index 31f013f..a6dc410 100644 --- a/src/Drago/Localization/TranslatorAdapter.php +++ b/src/Drago/Localization/TranslatorAdapter.php @@ -11,6 +11,7 @@ use Nette\Application\Attributes\Persistent; use Nette\Application\UI\Presenter; +use Nette\Neon\Exception; /** @@ -34,6 +35,9 @@ public function injectTranslator(Translator $translator, Presenter $presenter): } + /** + * @throws Exception + */ public function getTranslator(): Translator { $this->translator->setTranslate($this->lang);