Closed tacman closed 2 years ago
On a related note, I used rector to update the code to PHP 7.4, and it went smoothly. Although it's not necessary, PHP 7.4 allows for typed properties, which makes static analysis using tool like phpstan easier. Indeed, running phpstan on level 2 showed some issues. For example
/**
* Parses a duration and applies it to a date
*
* @param string $date
* @param string $duration
* @param string $format
* @return integer|\DateTime
*/
protected function parseDuration($date, $duration, $format = self::UNIX_FORMAT)
{
$dateTime = date_create($date);
$dateTime->modify(sprintf('%s year', $duration->y));
$duration is marked as a string, but it's obviously an object, and typing it in PHP would ultimately be a better practice. Not sure if it's worth the effort to make these changes, though.
See PR #309, 2c8cf55
Description of the Issue:
We can't update to the latest version of phpunit and support PHP 5.
Steps to Reproduce: