diff options
author | Jean Baptiste Noblot <noblot.jb@gmail.com> | 2020-03-04 19:04:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-04 19:04:07 +0300 |
commit | ff2296329e5a702f1513c7c356d86dbf2965c706 (patch) | |
tree | a96181c1531b696a0f5d555649a08935585800cd /core/Date.php | |
parent | cac7b9c0ba492c6c349fb502c1025c09bdcc22bb (diff) |
Fix void return used and "improve" isLeap in Date (#15662)
* let's PHP say is leap or not
* try to return a void function
Diffstat (limited to 'core/Date.php')
-rw-r--r-- | core/Date.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/Date.php b/core/Date.php index b436d91e1a..cc45fb98db 100644 --- a/core/Date.php +++ b/core/Date.php @@ -442,9 +442,9 @@ class Date */ public function isLeapYear() { - $currentYear = date('Y', $this->getTimestamp()); + $isLeap = (bool)(date('L', $this->getTimestamp())); - return ($currentYear % 400) == 0 || (($currentYear % 4) == 0 && ($currentYear % 100) != 0); + return $isLeap; } /** |