ZF2 EventManager change - BC BREAK

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

ZF2 EventManager change - BC BREAK

akrabat
Hi all,

With PR1669 (https://github.com/zendframework/zf2/pull/1669), I have changed events() to getEventManager() in EventsCapableInterface to make it consistent with setEventManager().

This obviously affects all uses of the event manager, so you'll have to change your code according.


Regards,

Rob...
Reply | Threaded
Open this post in threaded view
|

Re: ZF2 EventManager change - BC BREAK

Jurian Sluiman
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: ZF2 EventManager change - BC BREAK

HHGAG
In reply to this post by akrabat
+1

Hasan H. Gürsoy (HHGAG)

Jurian Sluiman <[hidden email]> schrieb:

2012/6/29 Rob Allen <[hidden email]>
Hi all,

With PR1669 (https://github.com/zendframework/zf2/pull/1669), I have changed events() to getEventManager() in EventsCapableInterface to make it consistent with setEventManager().

This obviously affects all uses of the event manager, so you'll have to change your code according.


Regards,

Rob...

I was thinking: in the zf2 code base the only places where accessors like this (instead of get*()) are used is the EventManager access and the Zend\Http\Request object. Is has setQuery() and query(), setPost() and post(). This is for the following accessors:
  • query()
  • post()
  • cookies()
  • file()
  • server()
  • env()
  • headers()
They all have mutators like setFile(), setEnv() etcetera. Also methods like setMethod() and setUri() have a getMethod() and a getUri(). Should we modify those accessors from the list above as well, to have everywhere the get*/set* accessor and be consistent with all their mutators?

If so, I'll PR for this change (as it needs to happen soon, before next Tuesday).
-- 
Jurian Sluiman
Hasan H. Gürsoy (HHGAG)
Reply | Threaded
Open this post in threaded view
|

Re: ZF2 EventManager change - BC BREAK

DeNix
In reply to this post by Jurian Sluiman
30.06.2012 14:07, Jurian Sluiman пишет:

I was thinking: in the zf2 code base the only places where accessors like this (instead of get*()) are used is the EventManager access and the Zend\Http\Request object. Is has setQuery() and query(), setPost() and post(). This is for the following accessors:
  • query()
  • post()
  • cookies()
  • file()
  • server()
  • env()
  • headers()
They all have mutators like setFile(), setEnv() etcetera. Also methods like setMethod() and setUri() have a getMethod() and a getUri(). Should we modify those accessors from the list above as well, to have everywhere the get*/set* accessor and be consistent with all their mutators?
+1
I'd also change file() to getFiles() (plural)

If so, I'll PR for this change (as it needs to happen soon, before next Tuesday).
-- 
Jurian Sluiman


Reply | Threaded
Open this post in threaded view
|

Re: ZF2 EventManager change - BC BREAK

Antoine Hedgecock
Im in favor of this

Best regards
Antoine Hedgecock
Senior developer / Server technician 
PMG Media Group AB
Tel: +46707972145

On Jun 30, 2012, at 1:27 PM, Denis Portnov wrote:

30.06.2012 14:07, Jurian Sluiman пишет:

I was thinking: in the zf2 code base the only places where accessors like this (instead of get*()) are used is the EventManager access and the Zend\Http\Request object. Is has setQuery() and query(), setPost() and post(). This is for the following accessors:
  • query()
  • post()
  • cookies()
  • file()
  • server()
  • env()
  • headers()
They all have mutators like setFile(), setEnv() etcetera. Also methods like setMethod() and setUri() have a getMethod() and a getUri(). Should we modify those accessors from the list above as well, to have everywhere the get*/set* accessor and be consistent with all their mutators?
+1
I'd also change file() to getFiles() (plural)

If so, I'll PR for this change (as it needs to happen soon, before next Tuesday).
-- 
Jurian Sluiman



Reply | Threaded
Open this post in threaded view
|

Re: ZF2 EventManager change - BC BREAK

Jurian Sluiman
In reply to this post by Jurian Sluiman
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: ZF2 EventManager change - BC BREAK

akrabat
In reply to this post by Jurian Sluiman

On 30 Jun 2012, at 11:07, Jurian Sluiman wrote:

I was thinking: in the zf2 code base the only places where accessors like this (instead of get*()) are used is the EventManager access and the Zend\Http\Request object. Is has setQuery() and query(), setPost() and post(). This is for the following accessors:
  • query()
  • post()
  • cookies()
  • file()
  • server()
  • env()
  • headers()
They all have mutators like setFile(), setEnv() etcetera. Also methods like setMethod() and setUri() have a getMethod() and a getUri(). Should we modify those accessors from the list above as well, to have everywhere the get*/set* accessor and be consistent with all their mutators?

If so, I'll PR for this change (as it needs to happen soon, before next Tuesday).

I'm +1 on this too, if you can get the PR sorted.

Regards,

Rob...


Reply | Threaded
Open this post in threaded view
|

Re: ZF2 EventManager change - BC BREAK

Gregory
maybe use $em instead of $events?

Not sure how others might feel about changing attach to
attachListener,  for some reason I have to keep remembering its for
attaching listeners and not events.
Reply | Threaded
Open this post in threaded view
|

Re: ZF2 EventManager change - BC BREAK

Jurian Sluiman
In reply to this post by akrabat
CONTENTS DELETED
The author has deleted this message.