Skip to content

Commit 127ea79

Browse files
committed
return types
1 parent 6a4a5ac commit 127ea79

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

src/Monolog/LogsHandler.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Monolog\Formatter\FormatterInterface;
88
use Monolog\Handler\HandlerInterface;
99
use Monolog\Logger as MonologLogger;
10+
use Monolog\LogRecord;
1011
use Sentry\Monolog\CompatibilityLogLevelTrait;
1112
use Sentry\Monolog\LogsHandler as BaseLogsHandler;
1213

@@ -30,11 +31,17 @@ public function __construct(int $level = MonologLogger::DEBUG, bool $bubble = tr
3031
$this->logsHandler = new BaseLogsHandler($logLevel, $bubble);
3132
}
3233

34+
/**
35+
* @param array<string, mixed>|LogRecord $record
36+
*/
3337
public function isHandling(array $record): bool
3438
{
3539
return $this->logsHandler->isHandling($record);
3640
}
3741

42+
/**
43+
* @param array<string, mixed>|LogRecord $record
44+
*/
3845
public function handle(array $record): bool
3946
{
4047
// Extra check required here because `isHandling` is not guaranteed to
@@ -46,6 +53,9 @@ public function handle(array $record): bool
4653
return false;
4754
}
4855

56+
/**
57+
* @param array<array<string, mixed>|LogRecord> $records
58+
*/
4959
public function handleBatch(array $records): void
5060
{
5161
$this->logsHandler->handleBatch($records);
@@ -56,6 +66,9 @@ public function close(): void
5666
$this->logsHandler->close();
5767
}
5868

69+
/**
70+
* @param callable $callback
71+
*/
5972
public function pushProcessor($callback): void
6073
{
6174
$this->logsHandler->pushProcessor($callback);

tests/End2End/App/Command/CrashCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(LoggerInterface $logger, string $subcommand = null)
2929
$this->subcommand = $subcommand;
3030
}
3131

32-
protected function execute(InputInterface $input, OutputInterface $output)
32+
protected function execute(InputInterface $input, OutputInterface $output): int
3333
{
3434
$this->logger->warning('Executing subcommand if exists');
3535

tests/End2End/App/Command/LoggingCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(LoggerInterface $logger)
2222
$this->logger = $logger;
2323
}
2424

25-
protected function execute(InputInterface $input, OutputInterface $output)
25+
protected function execute(InputInterface $input, OutputInterface $output): int
2626
{
2727
$this->logger->debug('Debug Log');
2828

tests/End2End/LoggingCommandTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ public function testExceptionLogsWithSubcommand(): void
9898
$this->assertEmpty($logEvent->getExceptions());
9999
}
100100

101+
/**
102+
* @param Log[] $logs
103+
* @param LogLevel $level
104+
* @return Log|null
105+
*/
101106
private function findOneByLevel(array $logs, LogLevel $level): ?Log
102107
{
103108
foreach ($logs as $log) {

0 commit comments

Comments
 (0)