Skip to content

Commit

Permalink
Merge pull request #534: PHP 8.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk authored Dec 9, 2024
2 parents a271938 + 00c4108 commit 5c86db5
Show file tree
Hide file tree
Showing 87 changed files with 276 additions and 247 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/run-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ jobs:
test:
name: PHP${{ matrix.php }}${{ matrix.extensions-suffix }}, ${{ matrix.os }}, ${{ matrix.dependencies }} deps
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.timeout-minutes }}
timeout-minutes: ${{ inputs.test-timeout }}
env: {GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'}
strategy:
fail-fast: ${{ inputs.fail-fast }}
matrix:
php: [ 8.1, 8.2, 8.3 ]
php: [ 8.1, 8.2, 8.3, 8.4 ]
os: [ ubuntu-latest ]
extensions-suffix: [ '', ', protobuf' ]
dependencies: [ lowest , highest ]
timeout-minutes: [ '${{ inputs.test-timeout }}' ]
include:
- os: windows-latest
extensions-suffix: ', protobuf'
php: 8.1
dependencies: highest
steps:
- name: Set Git To Use LF
run: |
Expand All @@ -78,6 +78,10 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Download CPX (PHP 8.4)
if: inputs.download-binaries == true && matrix.php == '8.4'
run: composer global require cpx/cpx

- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand All @@ -92,23 +96,37 @@ jobs:
php-${{ matrix.php }}-${{ matrix.os }}-composer-
- name: Install lowest dependencies from composer.json
if: matrix.dependencies == 'lowest'
if: matrix.dependencies == 'lowest' && matrix.php != '8.4'
run: composer update --no-interaction --no-progress --prefer-lowest

- name: Install lowest dependencies from composer.json ignoring ext-php constraint (PHP 8.4)
if: matrix.dependencies == 'lowest' && matrix.php == '8.4'
run: composer update --no-interaction --no-progress --prefer-lowest --ignore-platform-req php


- name: Validate lowest dependencies
if: matrix.dependencies == 'lowest'
if: matrix.dependencies == 'lowest' && matrix.php == '8.1'
env:
COMPOSER_POOL_OPTIMIZER: 0
run: vendor/bin/validate-prefer-lowest


- name: Install highest dependencies from composer.json
if: matrix.dependencies == 'highest'
if: matrix.dependencies == 'highest' && matrix.php != '8.4'
run: composer update --no-interaction --no-progress

- name: Download RoadRunner
if: inputs.download-binaries == true
run: |
vendor/bin/dload get --no-interaction -vv
- name: Install highest dependencies from composer.json ignoring ext-php constraint (PHP 8.4)
if: matrix.dependencies == 'highest' && matrix.php == '8.4'
run: composer update --no-interaction --no-progress --ignore-platform-req php


- name: Download binaries
if: inputs.download-binaries == true && matrix.php != '8.4'
run: composer get:binaries

- name: Download binaries (PHP 8.4)
if: inputs.download-binaries == true && matrix.php == '8.4'
run: cpx internal/dload get --no-interaction

- name: Run tests
run: ${{ inputs.test-command }}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"spiral/roadrunner-kv": "^4.2",
"spiral/roadrunner-worker": "^3.5",
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
"symfony/http-client": "^5.4 || ^6.0 || ^7.0",
"symfony/http-client": "^5.4.3 || ^6.0.3 || ^7.0",
"symfony/process": "^5.4 || ^6.0 || ^7.0"
},
"autoload": {
Expand All @@ -61,7 +61,6 @@
"phpunit/phpunit": "^10.5",
"spiral/code-style": "~2.1.2",
"spiral/core": "^3.13",
"symfony/var-dumper": "^6.0 || ^7.0",
"ta-tikoma/phpunit-architecture-test": "^0.8.4",
"vimeo/psalm": "^4.30 || ^5.4"
},
Expand All @@ -82,6 +81,7 @@
},
"scripts": {
"post-update-cmd": "Temporal\\Worker\\Transport\\RoadRunnerVersionChecker::postUpdate",
"get:binaries": "dload get --no-interaction -vv",
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots",
"cs:fix": "php-cs-fixer fix -v",
"psalm": "psalm",
Expand Down
2 changes: 1 addition & 1 deletion src/Activity/ActivityMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class ActivityMethod
#[Immutable]
public ?string $name = null;

public function __construct(string $name = null)
public function __construct(?string $name = null)
{
$this->name = $name;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Activity/ActivityOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function __construct()
/**
* @return $this
*/
public function mergeWith(MethodRetry $retry = null): self
public function mergeWith(?MethodRetry $retry = null): self
{
$self = clone $this;

Expand Down
2 changes: 1 addition & 1 deletion src/Activity/ActivityOptionsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
*/
interface ActivityOptionsInterface
{
public function mergeWith(MethodRetry $retry = null): self;
public function mergeWith(?MethodRetry $retry = null): self;
}
2 changes: 1 addition & 1 deletion src/Activity/LocalActivityOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function __construct()
/**
* @return $this
*/
public function mergeWith(MethodRetry $retry = null): self
public function mergeWith(?MethodRetry $retry = null): self
{
$self = clone $this;

Expand Down
8 changes: 4 additions & 4 deletions src/Client/GRPC/BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ public static function create(string $address): static
*/
public static function createSSL(
string $address,
string $crt = null,
string $clientKey = null,
string $clientPem = null,
string $overrideServerName = null,
?string $crt = null,
?string $clientKey = null,
?string $clientPem = null,
?string $overrideServerName = null,
): static {
if (!\extension_loaded('grpc')) {
throw new \RuntimeException('The gRPC extension is required to use Temporal Client.');
Expand Down
Loading

0 comments on commit 5c86db5

Please sign in to comment.