bkdotcom/PHPDebugConsole

View on GitHub
src/Debug/Psr3/CompatTrait_3.php

Summary

Maintainability
A
0 mins
Test Coverage
D
66%
<?php

namespace bdk\Debug\Psr3;

/*
    Wrap in condition.
    PHPUnit code coverage scans all files and will conflict
*/
if (\trait_exists(__NAMESPACE__ . '\\CompatTrait', false) === false) {
    /**
     * Provide log method with signature compatible with psr/log v3
     *
     * @phpcs:disable Generic.Classes.DuplicateClassName.Found
     */
    trait CompatTrait
    {
        /**
         * Logs with an arbitrary level.
         *
         * @param mixed              $level   debug, info, notice, warning, error, critical, alert, emergency
         * @param string|\Stringable $message message
         * @param mixed[]            $context array
         *
         * @return void
         *
         * @throws \Psr\Log\InvalidArgumentException
         */
        public function log($level, string|\Stringable $message, array $context = array()): void
        {
            $this->doLog($level, $message, $context);
        }
    }
}