Skip to content

Commit

Permalink
Merge 05adbda into 24bec32
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage committed Oct 19, 2021
2 parents 24bec32 + 05adbda commit 113cac5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
static_analysis:
name: Static analysis
runs-on: ubuntu-latest
strategy:
matrix:
symfonyVersion: [ ^4.4, ^5.0 ]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -32,11 +35,16 @@ jobs:
uses: actions/checkout@v2
- name: Install Dependencies
run: composer install
- name: Install Symfony
run: composer require -W symfony/framework-bundle:${{ matrix.symfonyVersion }} symfony/cache:${{ matrix.symfonyVersion }} symfony/console:${{ matrix.symfonyVersion }}
- name: Run static analysis
run: composer phpstan
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
symfonyVersion: [^4.4, ^5.0]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -46,6 +54,8 @@ jobs:
uses: actions/checkout@v2
- name: Install Dependencies
run: composer install
- name: Install Symfony
run: composer require -W symfony/framework-bundle:${{ matrix.symfonyVersion }} symfony/cache:${{ matrix.symfonyVersion }} symfony/console:${{ matrix.symfonyVersion }}
- name: Run tests
run: composer phpunit
coverage:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"minimum-stability": "stable",
"license": "MIT",
"require": {
"symfony/framework-bundle": "^5.0",
"symfony/framework-bundle": "^4.4 | ^5.0",
"rikudou/psr6-dynamo-db": "^2.0",
"php": "^7.2 | ^8.0",
"symfony/cache": "^5.0",
"symfony/cache": "^4.4 | ^5.0",
"ext-json": "*"
},
"autoload": {
Expand Down
20 changes: 17 additions & 3 deletions src/Session/DynamoDbSessionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,21 @@ public function updateTimestamp($key, $val): bool
return $this->cache->save($item);
}

protected function doRead(string $sessionId): string
/**
* @param string $sessionId
*/
protected function doRead($sessionId): string
{
return (string) $this->getCacheItem($sessionId)->get();
}

protected function doWrite(string $sessionId, string $data): bool
/**
* @param string $sessionId
* @param string $data
*
* @throws InvalidArgumentException
*/
protected function doWrite($sessionId, $data): bool
{
$item = $this->getCacheItem($sessionId);
$item->set($data);
Expand All @@ -74,7 +83,12 @@ protected function doWrite(string $sessionId, string $data): bool
return $this->cache->save($item);
}

protected function doDestroy(string $sessionId): bool
/**
* @param string $sessionId
*
* @throws InvalidArgumentException
*/
protected function doDestroy($sessionId): bool
{
return $this->cache->deleteItem($this->getCacheKey($sessionId));
}
Expand Down

0 comments on commit 113cac5

Please sign in to comment.