diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a82d7f6..9aff974 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,9 +13,9 @@ jobs: runs-on: [ubuntu-18.04] strategy: matrix: - php: [7.2] + php: ['7.2', '7.4', '8.0', '8.1'] steps: - - name: Setup PHP + - name: Setup PHP (PHP ${{ matrix.php }}) uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -24,9 +24,10 @@ jobs: - uses: actions/checkout@v1 - name: Install Composer dependencies run: composer install - - name: Coding standard + - uses: symfonycorp/security-checker-action@v3 + - name: Coding standard (PHP ${{ matrix.php }}) run: php${{ matrix.php }} ./vendor/bin/ecs check src tests - - name: PHPUnit tests + - name: PHPUnit tests (PHP ${{ matrix.php }}) run: php${{ matrix.php }} ./vendor/bin/phpunit --testdox --verbose --stop-on-failure - name: Code coverage run: php${{ matrix.php }} -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-clover=var/coverage.xml @@ -36,8 +37,5 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} file: ./var/coverage.xml fail_ci_if_error: true - - name: Upload coverage to Scrutinizer - run: | - wget https://scrutinizer-ci.com/ocular.phar - cp var/coverage.xml var/coverage.clover - php${{ matrix.php }} ocular.phar code-coverage:upload --access-token="${{ secrets.SCRUTINIZER_TOKEN }}" --format=php-clover var/coverage.clover + - name: Display the vulnerabilities as JSON + run: echo ${{ steps.security-check.outputs.vulns }} diff --git a/.gitignore b/.gitignore index 2516f29..f3a104c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ vendor composer.lock tests-api/.env var/ +.phpunit.result.cache diff --git a/composer.json b/composer.json index f6ced46..677517d 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "php": "^7.2|^8.0" }, "require-dev": { - "omnipay/tests": "^3", + "omnipay/tests": "^4", "symplify/easy-coding-standard": "^10.2", "symfony/var-dumper": "^5.4" } diff --git a/ecs.php b/ecs.php index 160ac3a..d77d062 100644 --- a/ecs.php +++ b/ecs.php @@ -7,7 +7,7 @@ use Symplify\EasyCodingStandard\ValueObject\Option; use Symplify\EasyCodingStandard\ValueObject\Set\SetList; -return static function (ECSConfig $ecsConfig): void { +return static function(ECSConfig $ecsConfig): void { $parameters = $ecsConfig->parameters(); $parameters->set(Option::PATHS, [ __DIR__ . '/src', diff --git a/src/Message/CompletePurchaseRequest.php b/src/Message/CompletePurchaseRequest.php index caaeb0f..c89f5c0 100644 --- a/src/Message/CompletePurchaseRequest.php +++ b/src/Message/CompletePurchaseRequest.php @@ -37,7 +37,7 @@ public function sendData($data) $responseData = json_decode($httpResponse->getBody()->getContents(), true); - return $this->response = new CompletePurchaseResponse($this, $responseData, $this->getEndpoint()); + return $this->response = new CompletePurchaseResponse($this, $responseData); } private function generateSignature(): string diff --git a/src/Message/RefundsResponse.php b/src/Message/RefundsResponse.php index c674c74..fb73199 100644 --- a/src/Message/RefundsResponse.php +++ b/src/Message/RefundsResponse.php @@ -21,7 +21,7 @@ public function __construct(RequestInterface $request, $data) } } - public function getRefunds(): array + public function getRefunds(): ?array { return $this->refunds; } diff --git a/tests/GatewayTest.php b/tests/GatewayTest.php index adeb3fc..6bfbbd9 100644 --- a/tests/GatewayTest.php +++ b/tests/GatewayTest.php @@ -22,7 +22,7 @@ class GatewayTest extends GatewayTestCase */ protected $gateway; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/Message/CardCharge3dsRequestTest.php b/tests/Message/CardCharge3dsRequestTest.php index b706979..1639c77 100644 --- a/tests/Message/CardCharge3dsRequestTest.php +++ b/tests/Message/CardCharge3dsRequestTest.php @@ -16,7 +16,7 @@ class CardCharge3dsRequestTest extends TestCase */ private $request; - public function setUp() + public function setUp(): void { $this->request = new CardCharge3dsRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize([