11<?php
22
3+ declare (strict_types=1 );
4+
35namespace Casbin \Bridge \Logger ;
46
5- use Casbin \Log \Logger as LoggerContract ;
7+ use Casbin \Log \Logger ;
68use Psr \Log \LoggerInterface ;
79
8- class LoggerBridge implements LoggerContract
10+ class LoggerBridge implements Logger
911{
12+ /**
13+ * Whether to enable logging.
14+ *
15+ * @var bool
16+ */
1017 public $ enable = false ;
1118
1219 /**
@@ -40,7 +47,7 @@ public function __construct(LoggerInterface $logger, $defaultLevel = 'info')
4047 *
4148 * @param bool $enable
4249 */
43- public function enableLog ($ enable )
50+ public function enableLog (bool $ enable ): void
4451 {
4552 $ this ->enable = $ enable ;
4653 }
@@ -50,7 +57,7 @@ public function enableLog($enable)
5057 *
5158 * @return bool
5259 */
53- public function isEnabled ()
60+ public function isEnabled (): bool
5461 {
5562 return $ this ->enable ;
5663 }
@@ -59,10 +66,8 @@ public function isEnabled()
5966 * formats using the default formats for its operands and logs the message.
6067 *
6168 * @param mixed ...$v
62- *
63- * @return mixed
6469 */
65- public function write (...$ v )
70+ public function write (...$ v ): void
6671 {
6772 if (!$ this ->enable ) {
6873 return ;
@@ -84,12 +89,10 @@ public function write(...$v)
8489 /**
8590 * formats according to a format specifier and logs the message.
8691 *
87- * @param $format
88- * @param mixed ...$v
89- *
90- * @return mixed
92+ * @param string $format
93+ * @param mixed ...$v
9194 */
92- public function writef ($ format , ...$ v )
95+ public function writef (string $ format , ...$ v ): void
9396 {
9497 if (!$ this ->enable ) {
9598 return ;
0 commit comments