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

Override visibility of AbstractController createForm #313

Closed
laurentmuller opened this issue Mar 23, 2023 · 0 comments · Fixed by #315
Closed

Override visibility of AbstractController createForm #313

laurentmuller opened this issue Mar 23, 2023 · 0 comments · Fixed by #315

Comments

@laurentmuller
Copy link

In the stub file AbstractController.stubphp for Symfony 6, the following code is wrong:

public function createForm(string $type, $data = null, array $options = []): FormInterface {}

The visibility of the AbstractController must be protected instead of public.

When we override the function in a controller, pslam complains with the following error:

OverriddenMethodAccess: Method App\Controller\AbstractController::createForm has different access level...

It is simply a matter of changing the visibility in the AbstractController.stubphp file:

protected function createForm(string $type, $data = null, array $options = []): FormInterface {}
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 a pull request may close this issue.

1 participant