Skip to content

Commit 8a5304c

Browse files
authored
Merge pull request #9 from polidog/feat/php8
Supported php8
2 parents 2d8f2a6 + dbafc77 commit 8a5304c

8 files changed

Lines changed: 38 additions & 25 deletions

File tree

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
max-parallel: 5
1010
matrix:
11-
php-versions: [ '7.3', '7.4' ]
11+
php-versions: [ '8.0', '8.1', '8.2' ]
1212

1313
steps:
1414
- uses: actions/checkout@v1
@@ -18,4 +18,4 @@ jobs:
1818
1919
- name: phpunit
2020
run: |
21-
composer test
21+
composer test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ vendor
44
.idea
55
.php_cs.cache
66
composer.lock
7+
.php-cs-fixer.cache
8+
.phpunit.result.cache

.php-cs-fixer.dist.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in(__DIR__)
5+
->exclude('vendor');
6+
7+
return (new PhpCsFixer\Config())
8+
->setRules([
9+
'@PSR12' => true,
10+
'strict_param' => true,
11+
'array_syntax' => ['syntax' => 'short'],
12+
'@PHP80Migration:risky' => true,
13+
])
14+
->setRiskyAllowed(true)
15+
->setFinder($finder)
16+
;

.php_cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

composer.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
}
1010
],
1111
"require": {
12-
"php": ">=7.3",
12+
"php": ">=8.0",
1313
"ext-json": "*",
1414
"guzzlehttp/guzzle": "~7.0"
1515
},
1616
"require-dev": {
17-
"phpunit/phpunit": "^5.7",
18-
"fabpot/php-cs-fixer": "^2.10"
17+
"phpunit/phpunit": "^9.6",
18+
"friendsofphp/php-cs-fixer": "^3.23",
19+
"phpspec/prophecy-phpunit": "^2.0"
1920
},
2021
"autoload": {
2122
"psr-4": {
@@ -28,6 +29,7 @@
2829
}
2930
},
3031
"scripts": {
31-
"test": "./vendor/bin/phpunit"
32+
"test": "./vendor/bin/phpunit",
33+
"cs-fix": "./vendor/bin/php-cs-fixer fix"
3234
}
3335
}

tests/ApiTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
use PHPUnit\Framework\TestCase;
88
use Polidog\Esa\Api;
99
use Polidog\Esa\Client\ClientInterface;
10+
use Prophecy\PhpUnit\ProphecyTrait;
1011

11-
class ApiTest extends TestCase
12+
final class ApiTest extends TestCase
1213
{
14+
use ProphecyTrait;
15+
1316
/**
1417
* @var \Prophecy\Prophecy\ObjectProphecy|ClientInterface
1518
*/

tests/Client/AuthorizationTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
use PHPUnit\Framework\TestCase;
99
use Polidog\Esa\Client\Authorization;
1010
use Prophecy\Argument;
11+
use Prophecy\PhpUnit\ProphecyTrait;
1112
use Psr\Http\Message\MessageInterface;
1213
use Psr\Http\Message\RequestInterface;
1314

14-
class AuthorizationTest extends TestCase
15+
final class AuthorizationTest extends TestCase
1516
{
17+
use ProphecyTrait;
18+
1619
public function testHandle(): void
1720
{
1821
$token = 'xxxxxxxxxxxxxxxxxx';

tests/Client/ClientTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
use Polidog\Esa\Client\Client;
1111
use Polidog\Esa\Exception\ClientException;
1212
use Prophecy\Argument;
13+
use Prophecy\PhpUnit\ProphecyTrait;
1314
use Psr\Http\Message\ResponseInterface;
1415
use Psr\Http\Message\StreamInterface;
1516

16-
class ClientTest extends TestCase
17+
final class ClientTest extends TestCase
1718
{
19+
use ProphecyTrait;
20+
1821
public function testFactory(): void
1922
{
2023
$client = Client::factory('token');

0 commit comments

Comments
 (0)