From 95f178caf9e92f4dfdcd13d9b7b337067a05127f Mon Sep 17 00:00:00 2001 From: Shabab Haider Siddique Date: Mon, 30 Jun 2025 19:45:03 +0600 Subject: [PATCH 1/2] PHP-775 updated deprecated syuntax for php8.4 compatibility, updated phpspec --- .github/workflows/php.yml | 6 +++--- composer.json | 3 ++- src/Exception/Request.php | 6 +++--- src/Method/Payment/Create.php | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 407641a..5f99bcf 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['7.2', '7.3', '7.4', '8.0','8.1','8.2','8.3'] + php-versions: ['7.2', '7.3', '7.4', '8.0','8.1','8.2','8.3','8.4'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@v4 with: php-version: ${{ matrix.php-versions }} diff --git a/composer.json b/composer.json index 9b90e03..8a76e30 100644 --- a/composer.json +++ b/composer.json @@ -12,10 +12,11 @@ }, "require-dev": { "monolog/monolog" : "~1.0", - "phpspec/phpspec" : "~6.2||7.*", + "phpspec/phpspec" : "~6.2||7.*||dev-main", "phpunit/phpunit" : "^8.5", "symfony/yaml" : ">=4.4" }, + "prefer-stable": true, "config": { "bin-dir": "bin" }, diff --git a/src/Exception/Request.php b/src/Exception/Request.php index 7cdc65a..62a07b1 100644 --- a/src/Exception/Request.php +++ b/src/Exception/Request.php @@ -10,10 +10,10 @@ class Request extends Runtime private $result; /** - * @param \Exception $previous - * @param ResultObjectInterface $result + * @param \Exception|null $previous + * @param ResultObjectInterface|null $result */ - public function __construct(\Exception $previous = null, ResultObjectInterface $result = null) + public function __construct(?\Exception $previous = null, ?ResultObjectInterface $result = null) { $this->message .= ' Response data: ' . serialize($result); parent::__construct($this->message, $this->code, $previous); diff --git a/src/Method/Payment/Create.php b/src/Method/Payment/Create.php index e7a0ecf..1d0083a 100644 --- a/src/Method/Payment/Create.php +++ b/src/Method/Payment/Create.php @@ -205,7 +205,7 @@ private function getCardHolderInfoConstraints(): object private function buildElement( string $typeValue, bool $isRequired = false, - array $length = null, + ?array $length = null, $args = null // TODO can it be null? ): object { From 0f5efb5d21e53e6b088ff7bb64830791e56d4c33 Mon Sep 17 00:00:00 2001 From: Shabab Haider Siddique Date: Mon, 30 Jun 2025 19:50:03 +0600 Subject: [PATCH 2/2] PHP-775 updated github action workflow settings --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 5f99bcf..e14960a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup PHP - uses: shivammathur/setup-php@v4 + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} @@ -25,7 +25,7 @@ jobs: - name: Cache Composer packages id: composer-cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: vendor key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}