It is generally recommended to explicitly declare the visibility for methods.
Adding explicit visibility (private, protected, or public) is generally
recommend to communicate to other developers how, and from where this method
is intended to be used.
It is generally recommended to explicitly declare the visibility for methods.
Adding explicit visibility (private, protected, or public) is generally
recommend to communicate to other developers how, and from where this method
is intended to be used.
Loading history...
29
self::$_now = $value;
30
}
31
32
33
/**
34
* @param string $format
35
* @param int|null $ts
36
* @return string
37
*/
38
static function format($format = self::FORMAT_YMDHIS, $ts = null) {
It is generally recommended to explicitly declare the visibility for methods.
Adding explicit visibility (private, protected, or public) is generally
recommend to communicate to other developers how, and from where this method
is intended to be used.
The expression $ts of type integer|null is loosely compared to false; this is ambiguous if the integer can be zero. You might want to explicitly use === null instead.
In PHP, under loose comparison (like ==, or !=, or switch conditions),
values of different types might be equal.
For integer values, zero is a special case, in particular the following
results might be unexpected:
0==false// true0==null// true123==false// false123==null// false// It is often better to use strict comparison0===false// false0===null// false
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.