Description
I have noticed in multiple places that getParams()
is expected to be set on the request object, despite the interface not requiring the getParams()
method. My understanding is that we're using DI and specifying the Interface, it means we shouldn't rely on methods not in the implementation interface.
Adding getParams()
to Magento\Framework\App\RequestInterface
seems like the right thing to do, and is a common method used by not only the core of Magento, but by extension developers too. I wouldn't feel comfortable using this method knowing that I can't rely on it existence.
More than happy to fork, and submit a pull request but it requires a fair bit of work - so before I commit to that I'd want approval :)
By searching for $this->getRequest()->getParams()
I was able to find 20 occurrences, 18 of which happen with app/code/Magento/*
. This is just for controllers, I'm sure there are instances in helpers and models where getParams from the request interface is used.
Thanks,
Ash Smith