Skip to content

Commit

Permalink
Update github actions and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jan 4, 2023
1 parent 975fc66 commit fe22f70
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
php: ['8.1']
php: ['8.1', '8.2']
stability: [prefer-lowest, prefer-stable]
include:
- php: '8.2'
flags: "--ignore-platform-req=php"
phpunit-flags: '--no-coverage'
stability: prefer-stable
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -36,8 +31,8 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.stability }}-${{ matrix.flags }}-${{ hashFiles('**/composer.lock') }}
Expand All @@ -53,7 +48,7 @@ jobs:

- name: Run static analysis
run: composer phpstan
if: ${{ matrix.php == '8.1' && matrix.stability == 'prefer-stable'}}
if: ${{ matrix.php == '8.2' && matrix.stability == 'prefer-stable'}}

- name: Run Coding style rules
run: composer phpcs:fix
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
"ext-json": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^v3.8.0",
"friendsofphp/php-cs-fixer": "^v3.13.2",
"guzzlehttp/guzzle": "^7.5",
"guzzlehttp/psr7": "^1.6 || ^2.4.3",
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-phpunit": "^1.2.2",
"phpstan/phpstan": "^1.9.6",
"phpstan/phpstan-phpunit": "^1.3.3",
"phpstan/phpstan-strict-rules": "^1.4.4",
"phpunit/phpunit": "^9.5.26",
"phpunit/phpunit": "^9.5.27",
"psr/http-factory": "^1.0.1",
"psr/simple-cache": "^1.0.1",
"symfony/cache": "^v5.0.0 || ^v6.0.0"
Expand All @@ -69,14 +69,14 @@
}
},
"scripts": {
"phpcs": "php-cs-fixer fix -vvv --diff --dry-run --allow-risky=yes --ansi",
"phpcs": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix -vvv --diff --dry-run --allow-risky=yes --ansi",
"phpcs:fix": "php-cs-fixer fix -vvv --allow-risky=yes --ansi",
"phpstan": "phpstan analyse -l max -c phpstan.neon src --memory-limit=256M --ansi",
"phpstan": "phpstan analyse -l max -c phpstan.neon src --xdebug --memory-limit=256M --ansi",
"phpunit": "XDEBUG_MODE=coverage phpunit --coverage-text",
"test": [
"@phpunit",
"@phpstan",
"@phpcs:fix"
"@phpcs"
]
},
"scripts-descriptions": {
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/TimeToLive.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static function fromDurationString(string $duration): DateInterval
set_error_handler(fn () => true);
$interval = DateInterval::createFromDateString($duration);
restore_error_handler();
if (!$interval instanceof DateInterval) { /* @phpstan-ignore-line */
if (!$interval instanceof DateInterval) {
throw new InvalidArgumentException(
'The ttl value "'.$duration.'" can not be parsable by `DateInterval::createFromDateString`.'
);
Expand Down

0 comments on commit fe22f70

Please sign in to comment.