Merge pull request #49145 from nextcloud/ci/noid/php-8.4

feat(PHP): Allow PHP 8.4
This commit is contained in:
Joas Schilling 2024-11-08 14:44:54 +01:00 committed by GitHub
commit 78cf3129aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 35 additions and 15 deletions

View file

@ -43,7 +43,7 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
php-versions: ['8.1', '8.3']
php-versions: ['8.1', '8.4']
ftpd: ['proftpd', 'vsftpd', 'pure-ftpd']
include:
- php-versions: '8.1'

View file

@ -41,7 +41,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']
include:
- php-versions: '8.2'
coverage: ${{ github.event_name != 'pull_request' }}

View file

@ -43,7 +43,7 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
php-versions: ['8.1', '8.3']
php-versions: ['8.1', '8.4']
sftpd: ['openssh']
include:
- php-versions: '8.1'

View file

@ -41,7 +41,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.1', '8.3']
php-versions: ['8.1']
include:
- php-versions: '8.1'
coverage: ${{ github.event_name != 'pull_request' }}

View file

@ -41,7 +41,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']
include:
- php-versions: '8.2'
coverage: ${{ github.event_name != 'pull_request' }}

View file

@ -40,7 +40,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']
include:
- php-versions: '8.2'
coverage: ${{ github.event_name != 'pull_request' }}

View file

@ -47,7 +47,7 @@ jobs:
strategy:
matrix:
php-versions: [ '8.1', '8.2', '8.3' ]
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
name: php-lint

View file

@ -61,6 +61,8 @@ jobs:
- php-versions: '8.3'
mariadb-versions: '10.11'
coverage: ${{ github.event_name != 'pull_request' }}
- php-versions: '8.4'
mariadb-versions: '11.4'
name: MariaDB ${{ matrix.mariadb-versions }} (PHP ${{ matrix.php-versions }}) - database tests

View file

@ -55,7 +55,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.1', '8.3']
php-versions: ['8.1', '8.3', '8.4']
include:
- php-versions: '8.2'
coverage: ${{ github.event_name != 'pull_request' }}

View file

@ -61,6 +61,8 @@ jobs:
- mysql-versions: '8.0'
php-versions: '8.3'
coverage: ${{ github.event_name != 'pull_request' }}
- mysql-versions: '8.4'
php-versions: '8.4'
name: MySQL ${{ matrix.mysql-versions }} (PHP ${{ matrix.php-versions }}) - database tests

View file

@ -57,7 +57,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.1', '8.3']
php-versions: ['8.1', '8.3', '8.4']
include:
- php-versions: '8.2'
coverage: ${{ github.event_name != 'pull_request' }}

View file

@ -66,6 +66,8 @@ jobs:
php-versions: '8.2'
- oracle-versions: '23'
php-versions: '8.3'
- oracle-versions: '23'
php-versions: '8.4'
name: Oracle ${{ matrix.oracle-versions }} (PHP ${{ matrix.php-versions }}) - database tests

View file

@ -62,6 +62,8 @@ jobs:
- php-versions: '8.3'
postgres-versions: '16'
coverage: ${{ github.event_name != 'pull_request' }}
- php-versions: '8.4'
postgres-versions: '16'
name: PostgreSQL ${{ matrix.postgres-versions }} (PHP ${{ matrix.php-versions }}) - database tests

View file

@ -55,7 +55,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.2', '8.3']
php-versions: ['8.2', '8.3', '8.4']
include:
- php-versions: '8.1'
coverage: ${{ github.event_name != 'pull_request' }}

View file

@ -55,6 +55,10 @@ class FileSearchBackendTest extends TestCase {
private $davFolder;
protected function setUp(): void {
if (PHP_VERSION_ID >= 80400) {
$this->markTestSkipped('SearchDAV is not yet PHP 8.4 compatible');
}
parent::setUp();
$this->user = $this->createMock(IUser::class);

View file

@ -34,6 +34,7 @@ class ExceptionSerializer {
'validateUserPass',
'loginWithToken',
'{closure}',
'{closure:*',
'createSessionToken',
// Provisioning
@ -200,7 +201,9 @@ class ExceptionSerializer {
return $this->editTrace($sensitiveValues, $traceLine);
}
foreach (self::methodsWithSensitiveParameters as $sensitiveMethod) {
if (str_contains($traceLine['function'], $sensitiveMethod)) {
if (str_contains($traceLine['function'], $sensitiveMethod)
|| (str_ends_with($sensitiveMethod, '*')
&& str_starts_with($traceLine['function'], substr($sensitiveMethod, 0, -1)))) {
return $this->editTrace($sensitiveValues, $traceLine);
}
}

View file

@ -878,7 +878,12 @@ class OC_Util {
* @return bool
*/
public static function isAnnotationsWorking() {
$reflection = new \ReflectionMethod(__METHOD__);
if (PHP_VERSION_ID >= 80300) {
/** @psalm-suppress UndefinedMethod */
$reflection = \ReflectionMethod::createFromMethodName(__METHOD__);
} else {
$reflection = new \ReflectionMethod(__METHOD__);
}
$docs = $reflection->getDocComment();
return (is_string($docs) && strlen($docs) > 50);

View file

@ -13,10 +13,10 @@ if (PHP_VERSION_ID < 80100) {
exit(1);
}
// Show warning if >= PHP 8.4 is used as Nextcloud is not compatible with >= PHP 8.4 for now
if (PHP_VERSION_ID >= 80400) {
// Show warning if >= PHP 8.5 is used as Nextcloud is not compatible with >= PHP 8.5 for now
if (PHP_VERSION_ID >= 80500) {
http_response_code(500);
echo 'This version of Nextcloud is not compatible with PHP>=8.4.<br/>';
echo 'This version of Nextcloud is not compatible with PHP>=8.5.<br/>';
echo 'You are currently running ' . PHP_VERSION . '.';
exit(1);
}