diff --git a/.github/patch-types.php b/.github/patch-types.php new file mode 100644 index 000000000000..d64325f6c8b4 --- /dev/null +++ b/.github/patch-types.php @@ -0,0 +1,45 @@ +addClassMap(['Symfony\Component\Debug\Exception\FlattenException' => \dirname(__DIR__).'/src/Symfony/Component/Debug/Exception/FlattenException.php']); + +return $loader; + +EOTXT +, file_get_contents(__DIR__.'/../vendor/autoload.php'))); + +$loader = require __DIR__.'/../vendor/autoload.php'; + +Symfony\Component\ErrorHandler\DebugClassLoader::enable(); + +foreach ($loader->getClassMap() as $class => $file) { + switch (true) { + case false !== strpos(realpath($file), '/vendor/'): + case false !== strpos($file, '/src/Symfony/Bridge/PhpUnit/'): + case false !== strpos($file, '/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Article.php'): + case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadParent.php'): + case false !== strpos($file, '/src/Symfony/Component/Debug/Tests/Fixtures/'): + case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Compiler/OptionalServiceClass.php'): + case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ParentNotExists.php'): + case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Prototype/BadClasses/MissingParent.php'): + case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/'): + case false !== strpos($file, '/src/Symfony/Component/ErrorHandler/Tests/Fixtures/'): + case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php'): + case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/ParentDummy.php'): + case false !== strpos($file, '/src/Symfony/Component/Serializer/Tests/Normalizer/Features/ObjectOuter.php'): + case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/NotLoadableClass.php'): + case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php') && \PHP_VERSION_ID < 70400: + continue 2; + } + + class_exists($class); +} + +Symfony\Component\ErrorHandler\DebugClassLoader::disable(); diff --git a/.travis.yml b/.travis.yml index 184398c68f5a..3627aaf18d34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ env: matrix: include: - php: 7.1 - env: php_extra="7.2" + env: php_extra="7.2 7.4snapshot" - php: 7.3 env: deps=high - php: 7.4snapshot @@ -79,10 +79,8 @@ before_install: export COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n') find ~/.phpenv -name xdebug.ini -delete - if [[ $TRAVIS_PHP_VERSION = 7.4* && $deps ]]; then + if [[ $TRAVIS_PHP_VERSION = 7.4* ]]; then export PHPUNIT_X="$PHPUNIT_X,issue-32995" - elif [[ $TRAVIS_PHP_VERSION = 7.4* ]]; then - export PHPUNIT_X="$PHPUNIT --group issue-32995" fi nanoseconds () { @@ -150,7 +148,7 @@ before_install: - | # php.ini configuration for PHP in $TRAVIS_PHP_VERSION $php_extra; do - phpenv global $PHP 2>/dev/null || (cd / && wget https://s3.amazonaws.com/travis-php-archives/binaries/ubuntu/14.04/x86_64/php-$PHP.tar.bz2 -O - | tar -xj) + phpenv global $PHP 2>/dev/null || (cd / && wget https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/16.04/x86_64/php-$PHP.tar.bz2 -O - | tar -xj) INI=~/.phpenv/versions/$PHP/etc/conf.d/travis.ini echo date.timezone = Europe/Paris >> $INI echo memory_limit = -1 >> $INI @@ -262,7 +260,7 @@ install: run_tests () { set -e export PHP=$1 - if [[ $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then + if [[ $PHP != 7.4* && $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m" break fi @@ -279,6 +277,17 @@ install: echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'" echo "$COMPONENTS" | xargs -n1 -I{} tar --append -f ~/php-ext/composer-lowest.lock.tar {}/composer.lock else + if [[ $PHP = 7.4* ]]; then + # add return types before running the test suite + rm vendor/symfony/contracts -Rf + ln -sd $(realpath src/Symfony/Contracts) vendor/symfony/contracts + sed -i 's/"\*\*\/Tests\/"//' composer.json + composer install --optimize-autoloader + php .github/patch-types.php + php .github/patch-types.php # ensure the script is idempotent + export PHPUNIT_X="$PHPUNIT_X,issue-32995,legacy" + fi + echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}" tfold src/Symfony/Component/Console.tty $PHPUNIT src/Symfony/Component/Console --group tty if [[ $PHP = ${MIN_PHP%.*} ]]; then diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php index ad1bd24d4ff9..27e08002155b 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -100,7 +100,7 @@ protected function doDestroy($sessionId) } /** - * @return int + * @return bool */ public function gc($maxlifetime) {