? ? ? Pending

User tests: Successful: Unsuccessful:

avatar eeshaanSA
eeshaanSA
22 May 2022

Pull Request for Issue #37823
Link for the issue:
https://github.com/joomla/joomla-cms/issues/37823

Summary of Changes

Changed the function name to avoid conflict with PHP keyword. Previously it was "match", but match is a PHP keyword since PHP 8.0, so changed it to "_match".

Open Questions:

I am unware of of the naming standards followed by the Joomla! team, so if you want me to change the name to something more 'understandable', let me know.
Other function names that I have in mind:

  • match_useragent
  • match_features

Actual result BEFORE applying this Pull Request

nil

Expected result AFTER applying this Pull Request

nil

Documentation Changes Required

None to my knowledge.

avatar eeshaanSA eeshaanSA - open - 22 May 2022
avatar eeshaanSA eeshaanSA - change - 22 May 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 May 2022
Category Libraries Unit Tests
avatar richard67
richard67 - comment - 22 May 2022

@eeshaanSA It seems you either have missed or not understood this comment in the issue: #37823 (comment) . It says that there is no need for this change here, but if you change it you have to keep the method with the old name and let it can a method with a new name, and the old method is to be deprecated and can be removed not before version 5.

So this PR here is wrong as it is now.

avatar richard67
richard67 - comment - 22 May 2022

P.S.: See also this doc about Joomla‘s semantic versioning https://developer.joomla.org/roadmap.html .

avatar eeshaanSA
eeshaanSA - comment - 22 May 2022

Sorry i missed the comment. So there are no changes required as of now?

avatar richard67
richard67 - comment - 22 May 2022

@eeshaanSA There are no changes REQUIRED. But what still CAN be done is to add a new method with a good name, let the old method with the „bad“ name call the new one so the old one is just a proxy to the new one, and add a deprecation note to the documentation block of the old method.

avatar richard67
richard67 - comment - 22 May 2022

So either close this PR or change it as requested in the above comment.

avatar eeshaanSA
eeshaanSA - comment - 23 May 2022

understood @richard67 . will try to work on the change.

avatar eeshaanSA
eeshaanSA - comment - 24 May 2022

@richard67 i would like some help on the deprecation note. along with the deprecated tag and the version, is there anything else I am supposed to mention in the documentation block of the method?

avatar richard67
richard67 - comment - 24 May 2022

@richard67 i would like some help on the deprecation note. along with the deprecated tag and the version, is there anything else I am supposed to mention in the documentation block of the method?

@eeshaanSA No, there isn't anything else. Just search for sting "@deprecated" in PHP files and you will find examples. I suggest you change this PR, then we (me or other maintainers or contributors) can suggest changes if necessary.

avatar ditsuke
ditsuke - comment - 24 May 2022

@eeshaanSA

See this for how to log the deprecation:

Log::add(
sprintf('%s() is deprecated and will be removed in 5.0. Use JFactory->getApplication()->get() instead.', __METHOD__),
Log::WARNING,
'deprecated'
);

avatar eeshaanSA eeshaanSA - change - 25 May 2022
Labels Added: ? ? ?
avatar eeshaanSA eeshaanSA - change - 25 May 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-05-25 11:16:35
Closed_By eeshaanSA
avatar eeshaanSA eeshaanSA - close - 25 May 2022
avatar eeshaanSA
eeshaanSA - comment - 25 May 2022

sorry, commited the same code by mistake. Deleted the whole PR. will submit a new one shortly and provide a link to it.

Add a Comment

Login with GitHub to post a comment