Problem/Motivation
I am getting the following error
Uncaught PHP Exception Error: "Typed property Drupal\simple_oauth\Server\ResourceServer::$subject must not be accessed before initialization"
When typed properties were introduced into classes in Php7.4, it became essential to initialise them before they were accessed. This is usually done in the class constructor, but it can be done by specifying a default value in the class where the property is defined.
This gives the potential for an error if the property is accessed before it is set, which is happening in my case.
Steps to reproduce
Proposed resolution
To avoid this problem, it would be useful to assign a default value to the typed property in the class ResourceServer where it is defined. This could be done with a statement like:
protected ?LeagueResourceServer $subject = NULL;
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3439309-typed-property-must-not-be-accessed-1.patch | 452 bytes | gnanagowthaman sankar |
Issue fork simple_oauth-3439309
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
gnanagowthaman sankar commentedPlease review and let me know for the changes.
Comment #4
dmgig commentedI get this error as well. Thank you.
Comment #6
bojan_dev commentedLooks good to me, TY!