laminas / laminas-log

Robust, composite logger with filtering, formatting, and PSR-3 support
https://docs.laminas.dev/laminas-log/
BSD 3-Clause "New" or "Revised" License
26 stars 30 forks source link

Wrong phpdoc for $message parameters #56

Closed alex-jonas closed 1 week ago

alex-jonas commented 1 week ago

Bug Report

Q A
Version(s) all?

Summary

The $message params for the methods in LoggerInterface have the wrong type annotation (Phpdoc). It's limited to string although Logger::log() does also accept Stringables and Arrays as message.

If you use the latter types, you must define exceptions in phpstan.

Current behavior

Wrong documentation on the LoggerInterface-methods for param $message. E.g.

    /**
     * @param string $message
     * @param array|Traversable $extra
     * @return LoggerInterface
     */
    public function crit($message, $extra = []);

How to reproduce

Log an Exception-Object as $message.

Expected behavior

Documentation reflects correctly which types are handled.

laminas-bot commented 1 week ago

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee. If you have a security issue, please follow our security reporting guidelines. If you wish to take on the role of maintainer, please nominate yourself

If you are looking for an actively maintained package alternative, we recommend: