phpFinTS
phpFinTS copied to clipboard
Logger returns invalid instance if not set before
There will be the following Error if you try to access the logger $fints->getLogger() but the logger was never set.
Uncaught TypeError: Fhp\FinTs::getLogger(): Return value must be of type Fhp\Options\SanitizingLogger, Psr\Log\NullLogger returned
https://github.com/nemiah/phpFinTS/blob/c1ef5dd303203234759b3761f7e378f5488de70a/lib/Fhp/FinTs.php#L31
https://github.com/nemiah/phpFinTS/blob/c1ef5dd303203234759b3761f7e378f5488de70a/lib/Fhp/FinTs.php#L117
The NullLogger is not a Child class of Fhp\Options\SanitizingLogger only of PSR\Log\AbstractLogger.
I think it would be best to implement a Custom NullLogger which inherits from our SanitizingLogger?