Skip to content

Commit 2780dc4

Browse files
committed
Fix types
1 parent edadef7 commit 2780dc4

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/Monolog/LogsHandler.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,31 @@ public function close(): void
8484
Logs::getInstance()->flush();
8585
}
8686

87-
public function pushProcessor($callback)
87+
/**
88+
* @param callable $callback
89+
*/
90+
public function pushProcessor($callback): void
8891
{
8992
// noop, this handler does not support processors
9093
}
9194

95+
/**
96+
* @return callable
97+
*/
9298
public function popProcessor()
9399
{
100+
// Since we do not support processors, we throw an exception if this method is called
94101
throw new \LogicException('You tried to pop from an empty processor stack.');
95102
}
96103

97-
public function setFormatter(FormatterInterface $formatter)
104+
public function setFormatter(FormatterInterface $formatter): void
98105
{
99-
// noop, this handler does not use a formatter
106+
// noop, this handler does not support formatters
100107
}
101108

102-
public function getFormatter()
109+
public function getFormatter(): FormatterInterface
103110
{
111+
// To adhere to the interface we need to return a formatter so we return a default one
104112
return new LineFormatter();
105113
}
106114
}

0 commit comments

Comments
 (0)