Problem/Motivation
The module use the reserved word "object" as part of namespace, and it's generate a warning compatibility with php 7+.
See: http://php.net/manual/en/reserved.other-reserved-words.php
FILE: /jsonrpc/src/Object/Response.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | 'object' is a soft reserved keyword as of PHP version 7.0 and a reserved keyword as of PHP version 7.2 and should not be used to name a class, interface or trait or as part of a namespace
| | (T_NAMESPACE)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /jsonrpc/src/Object/Request.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | 'object' is a soft reserved keyword as of PHP version 7.0 and a reserved keyword as of PHP version 7.2 and should not be used to name a class, interface or trait or as part of a namespace
| | (T_NAMESPACE)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /jsonrpc/src/Object/Error.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | 'object' is a soft reserved keyword as of PHP version 7.0 and a reserved keyword as of PHP version 7.2 and should not be used to name a class, interface or trait or as part of a namespace
| | (T_NAMESPACE)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /jsonrpc/src/Object/ParameterBag.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | 'object' is a soft reserved keyword as of PHP version 7.0 and a reserved keyword as of PHP version 7.2 and should not be used to name a class, interface or trait or as part of a namespace
| | (T_NAMESPACE)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Steps to reproduce
run ./vendor/bin/phpcs -p jsonrpc/ --runtime-set testVersion 7.4 --standard=PHPCompatibility --extensions=php,module,inc,install,test,profile,theme
Proposed resolution
Change the name from "Object" to "JsonRpcObject", the same happened with the json api core module, you can check here: https://www.drupal.org/project/jsonapi/issues/2971040
Comments
Comment #2
e0ipsoThanks for the report. I will take a look into it.
Comment #3
e0ipsoComment #4
e0ipsoComment #6
e0ipsoComment #8
e0ipsoI reverted this, since I did not realize this would cause a breaking change.
Comment #9
e0ipsoPostponing to the next major version, if ever.
Comment #12
sjerdo@e0ipso Since this commit is reverted, could you re-open this issue?
Comment #13
e0ipsoSure thing.
Comment #14
e0ipsoComment #15
er_abhinav commentedThese errors still exists with latest version on the module. Any plans to resolve these?
Comment #16
er_abhinav commentede0ipso
CreditAttribution: e0ipso as a volunteer and at Lullabot for IBM commented 2 years ago
I reverted this, since I did not realize this would cause a breaking change.
@e0ipso Can you provide some details, about issues caused by patch as it looks fine you just replaces Object with another word. If you can provide some details about issues you faced I can give it a try to create a patch.
Comment #17
ptmkenny commentedThis could be part of the 3.0 release of this module.
Comment #18
ptmkenny commentedDiscussion on similar changes:
#3216613: 'resource' is a soft reserved keyword as of PHP version 7.0 and should not be used to name a class, interface or trait or as part of a namespace (T_NAMESPACE)
Note that the linked issue describes a soft reserved keyword, whereas object is not soft; it is a "reserved keyword".
Comment #19
ptmkenny commentedComment #21
ptmkenny commentedComment #23
ptmkenny commented