Jump to content

Breaking Changes in 4.1.6


Kevin Carwile

Recommended Posts

Posted

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?

Posted

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.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...