? ? Failure

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
17 Sep 2016

Summary of Changes

For methods requiring a valid callback to be injected, use PHP 5.4's callable typehinting to indicate this versus relying on the methods to implement checks internally (and in some cases there are no checks, making it possible to break other things if incorrect objects are injected). This improves the code structure and API by explicitly declaring requirements and allowing the PHP engine to test them.

Outstanding Issues

This will introduce a new warning to the UI:

Warning: Declaration of JCacheControllerCallback::get(callable $callback, $args = Array, $id = false, $wrkarounds = false, $woptions = Array) should be compatible with JCacheController::get($id, $group = NULL)

This has always been an issue with the JCacheController classes. JCacheController aims to be a usable generic controller and each of the subclasses has a different signature for the get() method. This API needs to be looked at and a way of handling the different method signatures needs to be found.

Testing Instructions

With the exception of the above mentioned warning, the CMS should continue to function as normal. Some examples of areas that would break with this patch applied:

  • Code using the cache API with the callback controller (the component and plugin helpers both do this)
  • Registering custom or overloaded JHtml helper methods
  • Custom router rules
  • Registering event handlers
  • Registering disconnect handlers for the database drivers
  • Registering custom handlers for various JLanguage features (some language packages are doing this with their localise classes)

Documentation Changes Required

Docs listing B/C breaking changes should include this pull request indicating that the method signatures for the methods changed here will require updating in subclasses.

avatar mbabker mbabker - open - 17 Sep 2016
avatar mbabker mbabker - change - 17 Sep 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Sep 2016
Category Libraries Unit Tests
avatar joomla-cms-bot joomla-cms-bot - change - 17 Sep 2016
Labels Added: ? ?
avatar wilsonge
wilsonge - comment - 18 Sep 2016

Can you rebase please?

avatar mbabker
mbabker - comment - 18 Sep 2016

Done

avatar wilsonge wilsonge - change - 18 Sep 2016
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-09-18 15:54:28
Closed_By wilsonge
avatar wilsonge wilsonge - change - 18 Sep 2016
Labels Added: ?
avatar zero-24
zero-24 - comment - 18 Sep 2016

Is it expected that travis fails here?

avatar wilsonge
wilsonge - comment - 18 Sep 2016

A train the moment all unit tests in 4.x break because of the rebuilt plugin system. Michael has an open PR to fix a lot of them!

avatar zero-24
zero-24 - comment - 18 Sep 2016

Sorry i have not seen it. I can check it if i'm back home. I'm in the airplane from #jd16de back home now ;)

avatar mbabker
mbabker - comment - 18 Sep 2016

#12064 fixes most of it. I have a branch I'm testing the PHPCS fixes against right now to fix that job. All that's left is addressing the memory limit issue on the PHP 7 job and everything will be green.

avatar wilsonge
wilsonge - comment - 7 Aug 2018

Now documented

Add a Comment

Login with GitHub to post a comment