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

[12.x] Fix missing method on WebhookController #1080

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

driesvints
Copy link
Member

Fixes #1079

@rabol
Copy link

rabol commented Apr 27, 2021

Seems like the code is lost - if you look at the current version the code is different

@driesvints
Copy link
Member Author

@rabol
Copy link

rabol commented Apr 27, 2021

8199445

look at the method:

public function missingMethod($parameters = [])
    {
        return new Response('Missing event type: '.$parameters['type']);
    }

in the original PR

and then look at the current version

/**
     * Handle calls to missing methods on the controller.
     *
     * @param  array  $parameters
     * @return \Symfony\Component\HttpFoundation\Response
     */
    protected function missingMethod($parameters = [])
    {
        return new Response;
    }

@driesvints
Copy link
Member Author

@rabol you're pointing to code in a test. The method in the missingMethod method of the WebhookController is suppose to be empty.

@rabol
Copy link

rabol commented Apr 27, 2021

well, the original bug was that a parameter was passed to the missingMethod, but never used
and the 'fix' was that parameter should be used, e.g. in the Response og Log::info()

if the 'missingMethod' don 'report' that something is missing, then it is difficult to figure out which method is missing

@rabol
Copy link

rabol commented Apr 27, 2021

aha.... go it, one have to create a new controller, and override to capture it

@driesvints
Copy link
Member Author

driesvints commented Apr 27, 2021

Yes, the parameters are simple there to let anyone who wants to override the method and make use of it. The test is an example of that usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pass parameters to missingMethod in the method handleWebhook in WebhookController
3 participants