Skip to content

Commit 4cda3ed

Browse files
authored
Merge pull request #478 from greg0ire/recent-psr-log
Use recent versions of psr/log and Monolog
2 parents 52670a6 + 0eff20b commit 4cda3ed

File tree

6 files changed

+63
-58
lines changed

6 files changed

+63
-58
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"phpdocumentor/guides-restructured-text": "@dev",
4141
"phpdocumentor/guides-theme-bootstrap": "@dev",
4242
"psr/event-dispatcher": "^1.0",
43-
"psr/log": "^1.1",
43+
"psr/log": "^2.0 || ^3.0",
4444
"symfony/contracts": "^2.5 || ^3.0",
4545
"symfony/http-client": "^5.4.25 || ^6.3",
4646
"symfony/process": "^5.4 || ^6.3",

composer.lock

Lines changed: 55 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/guides-cli/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
],
2727
"require": {
2828
"php": "^8.1",
29-
"monolog/monolog": "^2.9",
29+
"monolog/monolog": "^2.9 || ^3.0",
3030
"phpdocumentor/guides": "self.version",
3131
"phpdocumentor/guides-restructured-text": "self.version",
3232
"symfony/config": "^5.4 || ^6.3",

packages/guides-cli/src/Logger/SpyProcessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace phpDocumentor\Guides\Cli\Logger;
66

7+
use Monolog\LogRecord;
78
use Monolog\Processor\ProcessorInterface;
89

910
/**
@@ -20,8 +21,7 @@ public function hasBeenCalled(): bool
2021
return $this->hasBeenCalled;
2122
}
2223

23-
/** @inheritDoc */
24-
public function __invoke(array $record): array
24+
public function __invoke(array|LogRecord $record): array|LogRecord
2525
{
2626
$this->hasBeenCalled = true;
2727

packages/guides/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
"webmozart/assert": "^1.11"
3535
},
3636
"require-dev": {
37-
"psr/log": "^1.0"
37+
"psr/log": "^2.0 || ^3.0"
3838
}
3939
}

tests/Functional/FunctionalTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use League\Flysystem\Memory\MemoryAdapter;
1111
use Monolog\Handler\TestHandler;
1212
use Monolog\Logger;
13+
use Monolog\LogRecord;
1314
use phpDocumentor\Guides\ApplicationTestCase;
1415
use phpDocumentor\Guides\Compiler\Compiler;
1516
use phpDocumentor\Guides\Compiler\CompilerContext;
@@ -131,8 +132,8 @@ public function testFunctional(
131132
assert($logHandler instanceof TestHandler);
132133

133134
$logRecords = array_map(
134-
static fn (array $log) => $log['level_name'] . ': ' . $log['message'],
135-
array_filter($logHandler->getRecords(), static fn (array $log) => $log['level'] >= Logger::WARNING),
135+
static fn (array|LogRecord $log) => $log['level_name'] . ': ' . $log['message'],
136+
array_filter($logHandler->getRecords(), static fn (array|LogRecord $log) => $log['level'] >= Logger::WARNING),
136137
);
137138
self::assertEquals($expectedLogs, $logRecords);
138139
} catch (ExpectationFailedException $e) {

0 commit comments

Comments
 (0)