Problem/Motivation

Declaring ::setUp without a void return typehint in
    Drupal\Tests\token\Functional\TokenBlockTest is deprecated in
    drupal:9.0.0. Typehinting will be required before drupal:10.0.0. See
    https://www.drupal.org/node/3114724

Steps to reproduce

Runs IMCE test

Proposed resolution

Declare ::setUp with a void return typehint

Change records: https://www.drupal.org/node/3114724

CommentFileSizeAuthor
#5 3191112-5-D9.patch8.83 KBmrinalini9
#2 3191112-2-D9.patch8.41 KBthalles

Comments

thalles created an issue. See original summary.

thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new8.41 KB

Follow a patch

Status: Needs review » Needs work

The last submitted patch, 2: 3191112-2-D9.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

tr’s picture

Patch needs to be re-rolled to include changes to LanguageTest, which is a new test added after the patch was posted in #2.

The reason for the test failure is that the return type syntax only works on PHP 7.1+, but the test used PHP 7.0 which doesn't support that syntax.

Because Drupal 8 supports PHP 7.0.8+, in order to make this change the Token module would have to impose a minimum PHP version greater than the Drupal core minimum. Or simply wait a few months until Drupal 8 is no longer supported, as Drupal 9 requires a at least PHP 7.3 so this will work in D9.

mrinalini9’s picture

Status: Needs work » Needs review
StatusFileSize
new8.83 KB

Rerolled patch #2 to include changes to LanguageTest as well, please review it.
Thanks!

berdir’s picture

Fixed coding standards, removed the unnecessary $modules argument and committed.

  • Berdir committed 88be474 on 8.x-1.x
    Issue #3191112 by thalles, mrinalini9, Berdir: Declaring ::setUp without...
berdir’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.