Skip to content

Commit

Permalink
PHPLIB-955: Require PHP 8.1 (mongodb#1374)
Browse files Browse the repository at this point in the history
* PHPLIB-955: Require PHP 8.1

* Apply automated phpcs fixes for PHP 8.1

* Fix psalm issues

* Remove unnecessary type assertions

* Fix wrong type in DocumentsMatchConstraint

* Use constructor property promotion where possible

* Update Psalm baseline

* Remove commented code

* Use match statement instead of switch

* Fix breakage introduced by constructor property promotion

* Always access promoted options property in constructor

* Restore PackedArray as invalid document in tests
  • Loading branch information
alcaeus committed Sep 9, 2024
1 parent 0ae74da commit 24214b6
Show file tree
Hide file tree
Showing 150 changed files with 693 additions and 1,669 deletions.
1 change: 0 additions & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,3 @@ include:
- filename: .evergreen/config/generated/test/require-api-version.yml
- filename: .evergreen/config/generated/test/csfle.yml
- filename: .evergreen/config/generated/test-variant/modern-php-full.yml
- filename: .evergreen/config/generated/test-variant/legacy-php-full.yml
14 changes: 1 addition & 13 deletions .evergreen/config/build-task-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,10 @@ task_groups:
# Builds all versions of PHP
- name: "build-all-php"
# Keep this number in sync with the number of PHP versions to allow for parallel builds
max_hosts: 4
max_hosts: 3
setup_task: *build_setup
setup_task_can_fail_task: true
setup_task_timeout_secs: 1800
teardown_task: *build_teardown
tasks:
- ".build"

# Builds all versions of PHP that support OpenSSL 3 (PHP 8.1+)
- name: "build-php-openssl3"
# Keep this number in sync with the number of PHP versions to allow for parallel builds
# Subtract 2 versions as PHP 7.4 and 8.0 are not built with OpenSSL 3
max_hosts: 2
setup_task: *build_setup
setup_task_can_fail_task: true
setup_task_timeout_secs: 1800
teardown_task: *build_teardown
tasks:
- ".build !.php7.4 !.php8.0"
8 changes: 4 additions & 4 deletions .evergreen/config/build-variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildvariants:
tags: ["build", "debian", "x64"]
run_on: debian12-small
tasks:
- name: "build-php-openssl3"
- name: "build-all-php"
- name: build-debian11
display_name: "Build: Debian 11"
tags: ["build", "debian", "x64", "pr", "tag"]
Expand All @@ -34,7 +34,7 @@ buildvariants:
tags: ["build", "rhel", "x64", "pr", "tag"]
run_on: rhel90-small
tasks:
- name: "build-php-openssl3"
- name: "build-all-php"
- name: build-rhel83-zseries
display_name: "Build: RHEL 8.3 Zseries"
tags: ["build", "rhel", "zseries", "tag"]
Expand Down Expand Up @@ -66,13 +66,13 @@ buildvariants:
tags: ["build", "ubuntu", "x64", "pr", "tag"]
run_on: ubuntu2204-small
tasks:
- name: "build-php-openssl3"
- name: "build-all-php"
- name: build-ubuntu2204-arm64
display_name: "Build: Ubuntu 22.04 ARM64"
tags: ["build", "ubuntu", "arm64", "tag"]
run_on: ubuntu2204-arm64-small
tasks:
- name: "build-php-openssl3"
- name: "build-all-php"
- name: build-ubuntu2004
display_name: "Build: Ubuntu 20.04 x64"
tags: ["build", "ubuntu", "x64", "pr", "tag"]
Expand Down
10 changes: 2 additions & 8 deletions .evergreen/config/generate-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
<?php

// Supported PHP versions. Add new versions to the beginning of the list
$modernPhpVersions = [
$supportedPhpVersions = [
'8.3',
'8.2',
'8.1',
];
$legacyPhpVersions = [
'8.0',
'7.4',
];
$supportedPhpVersions = array_merge($modernPhpVersions, $legacyPhpVersions);

$latestPhpVersion = max($supportedPhpVersions);
$lowestPhpVersion = min($supportedPhpVersions);
Expand Down Expand Up @@ -59,8 +54,7 @@
$allFiles[] = generateConfigs('tasks', 'test', 'mongodbVersion', 'csfle.yml', $csfleServerVersions);

// Test variants
$allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'modern-php-full.yml', $modernPhpVersions);
$allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'legacy-php-full.yml', $legacyPhpVersions);
$allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'modern-php-full.yml', $supportedPhpVersions);
// TODO: Re-enable when 1.20.0 is released
// $allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'phpc.yml', [$latestPhpVersion]);
// $allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'lowest.yml', [$lowestPhpVersion]);
Expand Down
84 changes: 0 additions & 84 deletions .evergreen/config/generated/build/build-extension.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 0 additions & 114 deletions .evergreen/config/generated/test-variant/legacy-php-full.yml

This file was deleted.

56 changes: 0 additions & 56 deletions .evergreen/config/templates/test-variant/legacy-php-full.yml

This file was deleted.

12 changes: 5 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
os:
- "ubuntu-20.04"
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
Expand All @@ -41,23 +39,23 @@ jobs:
- "server"
include:
- os: "ubuntu-20.04"
php-version: "8.0"
php-version: "8.1"
mongodb-version: "6.0"
topology: "replica_set"
- os: "ubuntu-20.04"
php-version: "8.0"
php-version: "8.1"
mongodb-version: "6.0"
topology: "sharded_cluster"
- os: "ubuntu-20.04"
php-version: "8.0"
php-version: "8.1"
mongodb-version: "5.0"
topology: "server"
- os: "ubuntu-20.04"
php-version: "8.0"
php-version: "8.1"
mongodb-version: "4.4"
topology: "replica_set"
- os: "ubuntu-20.04"
php-version: "8.0"
php-version: "8.1"
mongodb-version: "4.4"
topology: "sharded_cluster"

Expand Down
Loading

0 comments on commit 24214b6

Please sign in to comment.