2011年2月1日星期二

Re: [fw-mvc] PHP strict notice fired on a custom controller plugin

Hey Nathan,

The signature can be more restrictive, not less. The super technical
reasoning behind this is that PHP follows the Liskov Substitution Principle:

http://en.wikipedia.org/wiki/Liskov_substitution_principle

More info than you needed i'm sure, but here is what you need to do:

> class My_Plugin_AuthAccess extends Zend_Controller_Plugin_Abstract
> {
> public function preDispatch($request)
> {

Should be:

public function preDispatch(Zend_Controller_Request_Abstract $request)

That will remove the strict notice.

Hope that helps-
ralph

没有评论: