Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension Generator in CLI may produce broken PHP for certain extensions #1624

Closed
dougblackjr opened this issue Dec 8, 2021 · 0 comments · Fixed by #1625
Closed

Extension Generator in CLI may produce broken PHP for certain extensions #1624

dougblackjr opened this issue Dec 8, 2021 · 0 comments · Fixed by #1625

Comments

@dougblackjr
Copy link
Contributor

Description of the problem

The CLI add-on generator utilizes the extension hooks in the documentation, some of which are documented as sending in $this as the parameter. The add-on generator uses this in the enum, producing invalid PHP.

For example, I create an extension using the sessions_end hook:
Screenshot from 2021-12-08 08-47-47

The documentation states that $this is sent in:
Screenshot from 2021-12-08 08-49-25

However, this is invalid PHP:
Screenshot from 2021-12-08 08-51-05

How To Reproduce

  1. Create an extension on the CLI utilizing a hook that has $this labeled as a parameter in the documentation.
  2. Lint the created extension.

Error Messages
PHP Fatal error: Cannot use $this as parameter

Possible Solution
Change $this to $obj in the associated extension hooks.

intoeetive added a commit that referenced this issue Apr 13, 2022
…-generator

Resolved #1624 where generating extensions using CLI could produce broken PHP code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant