8000 [travis] use PHP 8.0 to patch return types · symfony/symfony@b9fe96e · GitHub
[go: up one dir, main page]

Skip to content

Commit b9fe96e

Browse files
[travis] use PHP 8.0 to patch return types
1 parent d23b74e commit b9fe96e

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

.github/patch-types.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,25 @@
2222

2323
foreach ($loader->getClassMap() as $class => $file) {
2424
switch (true) {
25-
case false !== strpos(realpath($file), '/vendor/'):
25+
case false !== strpos($file = realpath($file), '/vendor/'):
2626
case false !== strpos($file, '/src/Symfony/Bridge/PhpUnit/'):
2727
case false !== strpos($file, '/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Article.php'):
2828
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadFileName.php'):
2929
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadParent.php'):
3030
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/ParseError.php'):
3131
case false !== strpos($file, '/src/Symfony/Component/Debug/Tests/Fixtures/'):
3232
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Compiler/OptionalServiceClass.php'):
33-
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/CheckTypeDeclarationsPass/UnionConstructor.php'):
3433
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php'):
35-
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/uniontype_classes.php'):
34+
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/MultipleArgumentsOptionalScalarNotReallyOptional.php'):
3635
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ParentNotExists.php'):
3736
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Preload/'):
3837
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Prototype/BadClasses/MissingParent.php'):
3938
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/'):
4039
case false !== strpos($file, '/src/Symfony/Component/ErrorHandler/Tests/Fixtures/'):
4140
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php'):
4241
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/ParentDummy.php'):
43-
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php80Dummy.php'):
4442
case false !== strpos($file, '/src/Symfony/Component/Serializer/Tests/Normalizer/Features/ObjectOuter.php'):
4543
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/NotLoadableClass.php'):
46-
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/Php74.php') && \PHP_VERSION_ID < 70400:
4744
continue 2;
4845
}
4946

.github/rm-invalid-lowest-lock-files.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
error_reporting(-1);
44
set_error_handler(function ($type, $message, $file, $line) {
5-
if (error_reporting()) {
5+
if (error_reporting() & $type) {
66
throw new \ErrorException($message, 0, $type, $file, $line);
77
}
88
});

.travis.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ env:
2121
matrix:
2222
include:
2323
- php: 7.1
24-
env: php_extra="7.2 7.4"
25-
- php: 7.3
26-
env: deps=high
24+
env: php_extra="7.2 7.3 8.0"
2725
- php: 7.4
28-
env: deps=low
26+
env: deps=high
2927
- php: 8.0
30-
services: [memcached]
28+
env: deps=low
3129
fast_finish: true
3230

3331
cache:
@@ -248,7 +246,7 @@ install:
248246
set -e
249247
export PHP=$1
250248
251-
if [[ $PHP != 7.4* && $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
249+
if [[ $PHP != 8.0* && $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
252250
echo -e "\\n\\e[33;1mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
253251
return
254252
fi
@@ -283,12 +281,12 @@ install:
283281
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
284282
echo "$COMPONENTS" | xargs -n1 -I{} tar --append -f ~/php-ext/composer-lowest.lock.tar {}/composer.lock
285283
else
286-
if [[ $PHP = 7.4* ]]; then
284+
if [[ $PHP = 8.0* ]]; then
287285
# add return types before running the test suite
288286
sed -i 's/"\*\*\/Tests\/"//' composer.json
289287
composer install --optimize-autoloader
290-
SYMFONY_PATCH_TYPE_DECLARATIONS=force=object php .github/patch-types.php
291-
SYMFONY_PATCH_TYPE_DECLARATIONS=force=object php .github/patch-types.php # ensure the script is idempotent
288+
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php
289+
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php # ensure the script is idempotent
292290
PHPUNIT_X="$PHPUNIT_X,legacy"
293291
fi
294292

src/Symfony/Component/DependencyInjection/Tests/Loader/GlobFileLoaderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ class GlobFileLoaderWithoutImport extends GlobFileLoader
4040
{
4141
public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null, $exclude = null)
4242
{
43+
return null;
4344
}
4445
}

src/Symfony/Component/ErrorHandler/DebugClassLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ class DebugClassLoader
6767
'string' => 'string',
6868
'self' => 'self',
6969
'parent' => 'parent',
70+
'mixed' => 'mixed',
7071
] + (\PHP_VERSION_ID >= 80000 ? [
72+
'static' => 'static',
7173
'$this' => 'static',
7274
] : [
73-
'mixed' => 'mixed',
7475
'static' => 'object',
7576
'$this' => 'object',
7677
]);

0 commit comments

Comments
 (0)
0