? ? Success

User tests: Successful: Unsuccessful:

avatar izharaazmi
izharaazmi
4 Mar 2016

Summary of Changes

This method is a part of the parent class (PHP native DateTime) which is type-hinted to return DateTime. Marking return type to JDate when called as JDate method.

Testing Instructions

Only relevant for IDE (such as PHPStorm) users. Check the typehint of the return value from JDate::modify().
Without this patch it shows DateTime
After this patch it will show JDate

avatar izharaazmi izharaazmi - open - 4 Mar 2016
avatar izharaazmi izharaazmi - change - 4 Mar 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Mar 2016
Labels Added: ?
avatar wilsonge
wilsonge - comment - 6 Mar 2016

This can be JDate|false according to the PHP docs here http://php.net/manual/en/datetime.modify.php#refsect1-datetime.modify-returnvalues - can you amend please :)

avatar izharaazmi
izharaazmi - comment - 7 Mar 2016

The PHP Documentation shows the prototype like public DateTime DateTime::modify ( string $modify ). See DateTime::modify

Also the return tag is supposed to contain data types and not the values. Therefore, I think it should be JDate|bool instead of JDate|false if we want to hint false as a possible return value. See: PHPDoc @method and PHPDoc @return

Please advise.

avatar wilsonge
wilsonge - comment - 7 Mar 2016

Whatever PHPDoc says :)

avatar izharaazmi
izharaazmi - comment - 7 Mar 2016

I am in doubt because public DateTime DateTime::modify ( string $modify ) at PHP.net does not suggest bool as typehint but the description says so. True for many other PHP functions too.

Add bool to JDate::add, JDate::sub and JDate::modify?

avatar brianteeman brianteeman - change - 27 Mar 2016
Category Libraries
ae3e7eb 6 Jun 2016 avatar izharaazmi CS
avatar izharaazmi
izharaazmi - comment - 23 Aug 2016

@wilsonge One look please :)

avatar izharaazmi
izharaazmi - comment - 30 Sep 2016

Can we have this reviewed please!

avatar Bakual Bakual - change - 30 Sep 2016
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-09-30 12:25:18
Closed_By Bakual
avatar Bakual Bakual - close - 30 Sep 2016
avatar Bakual Bakual - merge - 30 Sep 2016
avatar Bakual Bakual - close - 30 Sep 2016
avatar Bakual Bakual - change - 30 Sep 2016
Labels Added: ?
avatar izharaazmi
izharaazmi - comment - 30 Sep 2016

@Bakual Thanks!

Add a Comment

Login with GitHub to post a comment