I am running php7 - String is a reserved word.

Here is the error.

Fatal error: Cannot use Drupal\graphql\Utility\String as String because 'String' is a special class name in XXX/drupal/modules/graphql/src/SchemaProvider/EntitySchemaProvider.php on line 17

Comments

martin107 created an issue. See original summary.

wim leers’s picture

Title: PHP7 - String needs renaming » PHP7 support - String class must be renamed, it is reserved in PHP7
Priority: Normal » Major

At least major, if not critical

martin107’s picture

Assigned: Unassigned » martin107

The class is a collection of statics

String should become StringHelper ?

I will have time for this over the weekend.

fubhy’s picture

Definitely at least Major. Also, big fail on my side for not testing with PHP7.

martin107’s picture

Assigned: martin107 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new8.16 KB

Also, big fail on my side for not testing with PHP7.

Ah no problem....it is easily corrected.

Instead of renaming the @file tag in the String class I just removed it as @file is deprecated.
I think I have refactored every call fingers crossed.

martin107’s picture

StatusFileSize
new8.16 KB

Sorry, I messup the file rename here is the interdiff.

diff --git a/src/Utility/SchemaHelper.php b/src/Utility/StringHelper.php
similarity index 100%
rename from src/Utility/SchemaHelper.php
rename to src/Utility/StringHelper.php

locally the test now passes.

  • fubhy committed 548c85a on 8.x-1.x authored by martin107
    Issue #2715609 by martin107: PHP7 support - String class must be renamed...

  • fubhy committed 548c85a on 8.x-2.x authored by martin107
    Issue #2715609 by martin107: PHP7 support - String class must be renamed...
fubhy’s picture

Status: Needs review » Fixed

Thanks martin!

Status: Fixed » Closed (fixed)

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