Skip to content

Commit

Permalink
Merge pull request #49 from kumamidori/feature/sdk_up_php81
Browse files Browse the repository at this point in the history
PHP8.1サポート追加と sentry/sentry 3.6, sentry/sdk 3.2 への更新
  • Loading branch information
kumamidori committed Jul 19, 2022
2 parents 99644a7 + dc076ec commit 83a1b0e
Show file tree
Hide file tree
Showing 6 changed files with 309 additions and 437 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Coding Standards

on:
push:
paths-ignore:
- '**.md'
pull_request:
workflow_dispatch:

Expand All @@ -16,7 +18,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
tools: cs2pr
coverage: none

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: Continuous Integration

on:
push:
paths-ignore:
- '**.md'
pull_request:
workflow_dispatch:
schedule:
- cron: '42 15 * * *'

jobs:
phpunit:
name: PHPUnit
Expand All @@ -18,6 +19,7 @@ jobs:
php-version:
- '7.4'
- '8.0'
- '8.1'
dependencies:
- lowest
- highest
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/static-analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Static Analysis

on:
push:
paths-ignore:
- '**.md'
pull_request:
workflow_dispatch:

Expand All @@ -16,7 +18,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
tools: cs2pr
coverage: none

Expand Down Expand Up @@ -47,7 +49,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
tools: cs2pr
coverage: none

Expand Down Expand Up @@ -100,7 +102,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
coverage: none

- name: Get composer cache directory
Expand All @@ -123,7 +125,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
coverage: none
tools: composer-require-checker

Expand Down
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@
"require": {
"php": "^7.4 || ^8.0",
"ext-json": "*",
"http-interop/http-factory-guzzle": "^1.0",
"ray/aop": "^2.10",
"ray/di": "^2.12",
"sentry/sdk": "^3.1",
"sentry/sentry": "^3.3"
"sentry/sdk": "^3.2.0",
"sentry/sentry": "^3.6.1",
"symfony/http-client": "^4.3|^5.0|^6.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.5",
"bear/package": "^1.10",
"bear/resource": "^1.15",
"bear/resource": "^1.16.1",
"bear/sunday": "^1.5.4",
"phpunit/phpunit": "^9.5",
"roave/security-advisories": "dev-master"
"roave/security-advisories": "dev-master",
"symfony/options-resolver": "^5.4.0"
},
"autoload": {
"psr-4": {
Expand Down
30 changes: 30 additions & 0 deletions tests/ResourceInterceptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,41 @@
use Ray\Aop\ReflectiveMethodInvocation;
use Ray\Di\Injector;

use function dirname;
use function restore_error_handler;
use function set_error_handler;
use function str_contains;

use const E_DEPRECATED;
use const PHP_VERSION_ID;

class ResourceInterceptorTest extends TestCase
{
private ?Transaction $transaction;
private ?ResourceTrace $trace;

protected function setUp(): void
{
parent::setUp();
if (PHP_VERSION_ID < 80100) {
return;
}

// Ray.Di 2.13.0後方互換のため refs. https://github.com/ray-di/Ray.Di/releases/tag/2.13.1
set_error_handler([$this, 'ignoreRayDiDeprecatedError']);
}

private function ignoreRayDiDeprecatedError(int $errno, string $s, string $file): bool
{
return $errno === E_DEPRECATED && str_contains($file, dirname(__DIR__) . '/vendor/ray/di');
}

protected function tearDown(): void
{
restore_error_handler();
parent::tearDown();
}

public function testInvokeThrowsExceptionCaseNotResource(): void
{
$this->expectException(UnsupportedTypeException::class);
Expand Down
Loading

0 comments on commit 83a1b0e

Please sign in to comment.