phpFinTS icon indicating copy to clipboard operation
phpFinTS copied to clipboard

Logger returns invalid instance if not set before

Open lukas-staab opened this issue 3 years ago • 0 comments

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?

lukas-staab avatar Aug 10 '22 12:08 lukas-staab