Skip to content

Fatal error when calling execute() #771

@kschroeder

Description

@kschroeder

This is more of a question than a bug, but when creating controllers without an execute() method defined for Magento\Framework\App\Action\Action there is a fatal error if that method is not defined. The dispatch() method calls the execute() method on itself. That's not really all that surprising. But I was wondering what the use case is that we don't define the method execute() as abstract, since it's technically a requirement if the dispatch() method is called. It may be a minor thing but I would rather get a compiler or IDE error instead of a runtime error, especially when the dependency on that method is known. Perhaps it relates to mocking action classes, I don't know, but I was wondering why that method is called without being declared as abstract.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions