Skip to content

Commit

Permalink
Merge pull request #9 from polidog/feat/php8
Browse files Browse the repository at this point in the history
Supported php8
  • Loading branch information
polidog committed Aug 17, 2023
2 parents 2d8f2a6 + dbafc77 commit 8a5304c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
php-versions: [ '7.3', '7.4' ]
php-versions: [ '8.0', '8.1', '8.2' ]

steps:
- uses: actions/checkout@v1
Expand All @@ -18,4 +18,4 @@ jobs:
- name: phpunit
run: |
composer test
composer test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ vendor
.idea
.php_cs.cache
composer.lock
.php-cs-fixer.cache
.phpunit.result.cache
16 changes: 16 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('vendor');

return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
'@PHP80Migration:risky' => true,
])
->setRiskyAllowed(true)
->setFinder($finder)
;
16 changes: 0 additions & 16 deletions .php_cs

This file was deleted.

10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
}
],
"require": {
"php": ">=7.3",
"php": ">=8.0",
"ext-json": "*",
"guzzlehttp/guzzle": "~7.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"fabpot/php-cs-fixer": "^2.10"
"phpunit/phpunit": "^9.6",
"friendsofphp/php-cs-fixer": "^3.23",
"phpspec/prophecy-phpunit": "^2.0"
},
"autoload": {
"psr-4": {
Expand All @@ -28,6 +29,7 @@
}
},
"scripts": {
"test": "./vendor/bin/phpunit"
"test": "./vendor/bin/phpunit",
"cs-fix": "./vendor/bin/php-cs-fixer fix"
}
}
5 changes: 4 additions & 1 deletion tests/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
use PHPUnit\Framework\TestCase;
use Polidog\Esa\Api;
use Polidog\Esa\Client\ClientInterface;
use Prophecy\PhpUnit\ProphecyTrait;

class ApiTest extends TestCase
final class ApiTest extends TestCase
{
use ProphecyTrait;

/**
* @var \Prophecy\Prophecy\ObjectProphecy|ClientInterface
*/
Expand Down
5 changes: 4 additions & 1 deletion tests/Client/AuthorizationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
use PHPUnit\Framework\TestCase;
use Polidog\Esa\Client\Authorization;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Http\Message\MessageInterface;
use Psr\Http\Message\RequestInterface;

class AuthorizationTest extends TestCase
final class AuthorizationTest extends TestCase
{
use ProphecyTrait;

public function testHandle(): void
{
$token = 'xxxxxxxxxxxxxxxxxx';
Expand Down
5 changes: 4 additions & 1 deletion tests/Client/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
use Polidog\Esa\Client\Client;
use Polidog\Esa\Exception\ClientException;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;

class ClientTest extends TestCase
final class ClientTest extends TestCase
{
use ProphecyTrait;

public function testFactory(): void
{
$client = Client::factory('token');
Expand Down

0 comments on commit 8a5304c

Please sign in to comment.