When enabling the module on a site using PHP 7.1 the following error is thrown:

Fatal error: Cannot use Drupal\Component\Utility\String as String because 'String' is a special class name in login_redirect.module on line 9

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new955 bytes

This removes the use statement in favor of a longer declaration.

astonvictor’s picture

Status: Needs review » Needs work

Cannot find \Drupal\Component\Utility\String class. I think we should use \Drupal\Component\Utility\SafeMarkup.

karuna patel’s picture

Status: Needs work » Needs review
StatusFileSize
new975 bytes

"String" will be a reserved word in PHP 7. The class \Drupal\Component\Utility\String is removed.
Replace calls to \Drupal\Component\Utility\String with calls to \Drupal\Component\Utility\SafeMarkup.

I have attached patch to fix this issue.