Using the file core-module in a BrowserTestBase-PHPUnit tests results with PHP 7.3 in failure like so

There was 1 error:

1) Drupal\Tests\genosharing\Functional\LoadTest::testBasicPages
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

/home/rainer/src/gs/web/core/modules/file/file.module:898
/home/rainer/src/gs/web/core/lib/Drupal/Core/Extension/Extension.php:140
/home/rainer/src/gs/web/core/lib/Drupal/Core/Extension/Extension.php:140
/home/rainer/src/gs/web/core/lib/Drupal/Core/Extension/ModuleHandler.php:128

PHP 7.3 has depreciated "continue", see here: https://wiki.php.net/rfc/continue_on_switch_deprecation

Change the "continue" statements in file.module's switch from line 893 to "continue 2" fixes the problem (for PHP 7.3).

Drupal 8.6.1
Apache/2.4.37 (Unix) PHP/7.3.0
Manjaro Linux

[rainer@tuxtop web]$ php -v
PHP 7.3.0 (cli) (built: Dec  8 2018 12:11:20) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.7.0beta1, Copyright (c) 2002-2018, by Derick Rethans
CommentFileSizeAuthor
#5 3025014-5.patch1.38 KBdan2k3k4
#4 3025014-4.patch1.36 KBdan2k3k4
#3 3025014-3.patch1.36 KBdan2k3k4

Comments

proxiss created an issue. See original summary.

fgm’s picture

Three similar case just in drush status:

 [warning] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? file.module:898
 [warning] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? file.module:904
 [warning] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? file.module:917
dan2k3k4’s picture

Status: Active » Needs review
StatusFileSize
new1.36 KB

Here's a quick patch that should fix the file.module

dan2k3k4’s picture

StatusFileSize
new1.36 KB

Fixed the patch paths.

dan2k3k4’s picture

StatusFileSize
new1.38 KB

Ok *this* should be the correct paths for the patch... sorry for spamming :)

The last submitted patch, 3: 3025014-3.patch, failed testing. View results

The last submitted patch, 4: 3025014-4.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 5: 3025014-5.patch, failed testing. View results

baikho’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2989734: PHP 7.3 compatibility

This seems to be a duplicate of PHP 7.3 compatibility which is already committed. Closing accordingly.