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...
18
{
19
$this->client = $client;
20
}
21
22
/**
23
* Convert a timestamp or DateTime to a millisecond timestamp.
24
*
25
* @param \DateTime|int|null $timestamp
26
* @return int|null
27
*/
28
protected function timestamp($timestamp)
29
{
30
switch (true) {
31
case $timestamp instanceof \DateTime:
32
return $timestamp->getTimestamp() * 1000;
33
case is_numeric($timestamp) && strlen((string)$timestamp) == 10:
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.