Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Kevin Carwile Posted January 5, 2016 Posted January 5, 2016 So with the update to version 4.1.6, the decision was made to make breaking changes to function signatures that cannot be fixed with any coding wizardry or exception handling. Any thoughts for how you want app developers to deal with this? One Example 4.1.5.2 and prior /** * Hide * * @param \IPS\Member|NULL $member The member doing the action (NULL for currently logged in member) * @param string $reason Reason * @return void */ public function hide( \IPS\Member $member=NULL, $reason=NULL ) 4.1.6 /** * Hide * * @param \IPS\Member|NULL|FALSE $member The member doing the action (NULL for currently logged in member, FALSE for no member) * @param string $reason Reason * @return void */ public function hide( $member, $reason=NULL ) I can't update my hook on the method to work with the new version without fatally breaking on any version of IPS lower than 4.1.6. What would you recommend I do here?
HeadStand Posted January 5, 2016 Posted January 5, 2016 Oh, that is so annoying. Like tear-my-hair-out-before-it-grays annoying.
Ryan H. Posted January 5, 2016 Posted January 5, 2016 Ack. I thought there was discussion about semantic versioning? Or was that all us? This is pretty antisemantic. e: Found what I had in mind, post by HeadStand a while back. No official comment.
Mark Posted January 5, 2016 Posted January 5, 2016 If your class overrides that method, you should modify the signature to not type-hint that parameter. PHP will throw a strict standards warning if someone installs that update on <4.1.6 (or vice-versa, doesn't install the update on >=4.1.6) but in a properly-configured production environment that will happen silently.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.