Open
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
Library version | 1.13.0 |
Following example, methods are just to mimic the behaviour.
<?php
class Date
{
private $datetime;
public static function getAvailable(): DateTime
{
$specific = self::getSpecific();
if ($specific) {
return $specific->dateTime();
}
return new DateTime();
}
private static function getSpecific(): ?Date
{
return new Date();
}
private function dateTime(): DateTime
{
return DateTime::createFromFormat('Y-m-d H:i:s', $this->datetime);
}
}
Insights reports incorrectly, that dateTime()
is unused:
[Code] Unused private elements:
Date.php:21: Class Date contains unused private method dateTime().