? Success

User tests: Successful: Unsuccessful:

avatar frankmayer
frankmayer
20 Dec 2016

Summary of Changes

  • More type-safe comparisons in site/templates

The changes in this PR should be fairly easy to review. They are only type safe int or bool comparisons. This PR is done, so the batch PR #12233 can become a little lighter and easier to review. In hope that this will get merged quickly so further work can be done without conflicting with other PRs. ;)

Testing Instructions

None, should not change behavior

Documentation Changes Required

None.

avatar frankmayer frankmayer - open - 20 Dec 2016
avatar frankmayer frankmayer - change - 20 Dec 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Dec 2016
Category Front End Templates (site)
avatar bertmert
bertmert - comment - 20 Dec 2016

Could you please explain why we need all these type-safe comparisons?

avatar frankmayer
frankmayer - comment - 20 Dec 2016

The quick points:

  • Good coding practice
  • More strict typing = less error prone code
  • Faster processing of such comparisons

There is lots of info on the web on this matter.

avatar mbabker
mbabker - comment - 20 Dec 2016

In general, type safety should be preferred, otherwise you run into a lot of funny PHP quirks.

Essentially, '0' == 0 == false == null in PHP with loose typing, same with '1' == 1 == true.

Newer PHP versions also start spitting errors when you give non-numeric types (only integer and float are numeric) to be processed for arithmetic operations, older versions were a little less restrictive and would try to do math on a string representation on the value.

avatar andrepereiradasilva
andrepereiradasilva - comment - 1 Jun 2017

I have tested this item successfully on 2e806ed

On code review


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13310.

avatar andrepereiradasilva andrepereiradasilva - test_item - 1 Jun 2017 - Tested successfully
avatar Quy
Quy - comment - 1 Jun 2017

I have tested this item successfully on 2e806ed

Code review.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13310.

avatar Quy Quy - test_item - 1 Jun 2017 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 2 Jun 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 Jun 2017

RTC after two successful tests.

avatar rdeutz rdeutz - close - 10 Jun 2017
avatar rdeutz rdeutz - merge - 10 Jun 2017
avatar rdeutz rdeutz - change - 10 Jun 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-06-10 18:50:39
Closed_By rdeutz
Labels Added: ?

Add a Comment

Login with GitHub to post a comment