Build error when building for PHP 8.0

Hello,

unfortunately we are getting build errors when building our application for PHP 8.0 on Travis CI.

We tried different operating systems, but we can’t get rid of the build error for PHP 8.0.

Our config looks like this:

dist: xenial

language: php

branches:
    only:
        - release
        - develop
        
env:
    global:
        - DATABASE_PORT=3306
        - DATABASE_HOST=mariadb_test
        - DATABASE_NAME=app_test

addons:
    mariadb: '10.5'
    hosts:
        - mariadb_test

matrix:
    fast_finish: true
    include:
        - php: 7.2
        - php: 7.3
        - php: 7.4
        - php: 8.0

cache:
    directories:
        - $HOME/.composer
        - $TRAVIS_BUILD_DIR/bin/.phpunit

before_install:
    - sudo mysql -u root -e 'CREATE DATABASE app_test;'
    - sudo mysql -u root -e "CREATE USER 'app'@'localhost' IDENTIFIED BY 'app';"
    - sudo mysql -u root -e "GRANT ALL ON app_test.* TO 'app'@'localhost';"

install:
    - COMPOSER_MEMORY_LIMIT=-1 travis_retry composer install --no-interaction
    - php bin/console doctrine:migrations:migrate --no-interaction --env=test
    - php bin/console doctrine:fixtures:load --no-interaction --env=test
    - openssl genrsa -out config/jwt/private-test.pem -aes256 -passout pass:app! 4096
    - openssl rsa -pubout -in config/jwt/private-test.pem -out config/jwt/public-test.pem -passin pass:app!

script:
    - $TRAVIS_BUILD_DIR/bin/phpunit -c config/ci/phpunit.xml.dist --no-coverage

The error we are getting for PHP 8.0 is

PHP Fatal error: Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs) in /home/travis/build/christiansiewert/aaas-api/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 81

Can you please tell us what could be the problem here?

We tested different operating systems on travis, but for PHP 8.0 we are getting the same error each time.

Our last three builds for…

Xenial: Travis CI - Test and Deploy Your Code with Confidence
Bionic: Travis CI - Test and Deploy Your Code with Confidence
Focal: Travis CI - Test and Deploy Your Code with Confidence

Is this a cache related problem or something like that?

Best,
Christian