Skip to content

Commit

Permalink
support PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
accgit authored and scrs_zdenek committed Aug 3, 2023
1 parent cba86fe commit 2280407
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coding-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.0']
php: ['8.1']

fail-fast: false

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": ">=8.0",
"php": ">=8.1",
"nette/di": "^3.0",
"nette/utils": "^3.1",
"nette/application": "^3.0"
Expand Down
10 changes: 10 additions & 0 deletions src/Drago/Localization/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Drago\Localization;

use Nette;
use Nette\Neon\Exception;
use Nette\Neon\Neon;


Expand All @@ -29,6 +30,9 @@ public function __construct(
}


/**
* @throws Exception
*/
private function decodeFile(string $file): array
{
$arr = [];
Expand All @@ -39,6 +43,9 @@ private function decodeFile(string $file): array
}


/**
* @throws Exception
*/
public function setTranslate(string $translate): array
{
$file = $this->translateDir . '/' . $translate . '.neon';
Expand All @@ -47,6 +54,9 @@ public function setTranslate(string $translate): array
}


/**
* @throws Exception
*/
public function setCustomTranslate(string $path, string $translate): array
{
$file = $path . $translate . '.neon';
Expand Down
4 changes: 4 additions & 0 deletions src/Drago/Localization/TranslatorAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Nette\Application\Attributes\Persistent;
use Nette\Application\UI\Presenter;
use Nette\Neon\Exception;


/**
Expand All @@ -34,6 +35,9 @@ public function injectTranslator(Translator $translator, Presenter $presenter):
}


/**
* @throws Exception
*/
public function getTranslator(): Translator
{
$this->translator->setTranslate($this->lang);
Expand Down

0 comments on commit 2280407

Please sign in to comment.