Skip to content

Commit 94a25b2

Browse files
committed
chore: update psr/log to v2.0
1 parent 5f73576 commit 94a25b2

7 files changed

Lines changed: 43 additions & 157 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"ext-json": "*",
1616
"ext-mbstring": "*",
1717
"laminas/laminas-escaper": "^2.9",
18-
"psr/log": "^1.1"
18+
"psr/log": "^2.0"
1919
},
2020
"require-dev": {
2121
"codeigniter/coding-standard": "^1.5",

‎system/ComposerScripts.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ final class ComposerScripts
5656
],
5757
'psr-log' => [
5858
'license' => __DIR__ . '/../vendor/psr/log/LICENSE',
59-
'from' => __DIR__ . '/../vendor/psr/log/Psr/Log/',
59+
'from' => __DIR__ . '/../vendor/psr/log/src/',
6060
'to' => __DIR__ . '/ThirdParty/PSR/Log/',
6161
],
6262
];
@@ -84,7 +84,6 @@ public static function postUpdate()
8484
}
8585

8686
self::copyKintInitFiles();
87-
self::recursiveDelete(self::$dependencies['psr-log']['to'] . 'Test/');
8887
}
8988

9089
/**

‎system/ThirdParty/PSR/Log/AbstractLogger.php‎

Lines changed: 1 addition & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -11,118 +11,5 @@
1111
*/
1212
abstract class AbstractLogger implements LoggerInterface
1313
{
14-
/**
15-
* System is unusable.
16-
*
17-
* @param string $message
18-
* @param mixed[] $context
19-
*
20-
* @return void
21-
*/
22-
public function emergency($message, array $context = array())
23-
{
24-
$this->log(LogLevel::EMERGENCY, $message, $context);
25-
}
26-
27-
/**
28-
* Action must be taken immediately.
29-
*
30-
* Example: Entire website down, database unavailable, etc. This should
31-
* trigger the SMS alerts and wake you up.
32-
*
33-
* @param string $message
34-
* @param mixed[] $context
35-
*
36-
* @return void
37-
*/
38-
public function alert($message, array $context = array())
39-
{
40-
$this->log(LogLevel::ALERT, $message, $context);
41-
}
42-
43-
/**
44-
* Critical conditions.
45-
*
46-
* Example: Application component unavailable, unexpected exception.
47-
*
48-
* @param string $message
49-
* @param mixed[] $context
50-
*
51-
* @return void
52-
*/
53-
public function critical($message, array $context = array())
54-
{
55-
$this->log(LogLevel::CRITICAL, $message, $context);
56-
}
57-
58-
/**
59-
* Runtime errors that do not require immediate action but should typically
60-
* be logged and monitored.
61-
*
62-
* @param string $message
63-
* @param mixed[] $context
64-
*
65-
* @return void
66-
*/
67-
public function error($message, array $context = array())
68-
{
69-
$this->log(LogLevel::ERROR, $message, $context);
70-
}
71-
72-
/**
73-
* Exceptional occurrences that are not errors.
74-
*
75-
* Example: Use of deprecated APIs, poor use of an API, undesirable things
76-
* that are not necessarily wrong.
77-
*
78-
* @param string $message
79-
* @param mixed[] $context
80-
*
81-
* @return void
82-
*/
83-
public function warning($message, array $context = array())
84-
{
85-
$this->log(LogLevel::WARNING, $message, $context);
86-
}
87-
88-
/**
89-
* Normal but significant events.
90-
*
91-
* @param string $message
92-
* @param mixed[] $context
93-
*
94-
* @return void
95-
*/
96-
public function notice($message, array $context = array())
97-
{
98-
$this->log(LogLevel::NOTICE, $message, $context);
99-
}
100-
101-
/**
102-
* Interesting events.
103-
*
104-
* Example: User logs in, SQL logs.
105-
*
106-
* @param string $message
107-
* @param mixed[] $context
108-
*
109-
* @return void
110-
*/
111-
public function info($message, array $context = array())
112-
{
113-
$this->log(LogLevel::INFO, $message, $context);
114-
}
115-
116-
/**
117-
* Detailed debug information.
118-
*
119-
* @param string $message
120-
* @param mixed[] $context
121-
*
122-
* @return void
123-
*/
124-
public function debug($message, array $context = array())
125-
{
126-
$this->log(LogLevel::DEBUG, $message, $context);
127-
}
14+
use LoggerTrait;
12815
}

‎system/ThirdParty/PSR/Log/LoggerAwareTrait.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ trait LoggerAwareTrait
1212
*
1313
* @var LoggerInterface|null
1414
*/
15-
protected $logger;
15+
protected ?LoggerInterface $logger = null;
1616

1717
/**
1818
* Sets a logger.

‎system/ThirdParty/PSR/Log/LoggerInterface.php‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,104 +22,104 @@ interface LoggerInterface
2222
/**
2323
* System is unusable.
2424
*
25-
* @param string $message
25+
* @param string|\Stringable $message
2626
* @param mixed[] $context
2727
*
2828
* @return void
2929
*/
30-
public function emergency($message, array $context = array());
30+
public function emergency(string|\Stringable $message, array $context = []);
3131

3232
/**
3333
* Action must be taken immediately.
3434
*
3535
* Example: Entire website down, database unavailable, etc. This should
3636
* trigger the SMS alerts and wake you up.
3737
*
38-
* @param string $message
38+
* @param string|\Stringable $message
3939
* @param mixed[] $context
4040
*
4141
* @return void
4242
*/
43-
public function alert($message, array $context = array());
43+
public function alert(string|\Stringable $message, array $context = []);
4444

4545
/**
4646
* Critical conditions.
4747
*
4848
* Example: Application component unavailable, unexpected exception.
4949
*
50-
* @param string $message
50+
* @param string|\Stringable $message
5151
* @param mixed[] $context
5252
*
5353
* @return void
5454
*/
55-
public function critical($message, array $context = array());
55+
public function critical(string|\Stringable $message, array $context = []);
5656

5757
/**
5858
* Runtime errors that do not require immediate action but should typically
5959
* be logged and monitored.
6060
*
61-
* @param string $message
61+
* @param string|\Stringable $message
6262
* @param mixed[] $context
6363
*
6464
* @return void
6565
*/
66-
public function error($message, array $context = array());
66+
public function error(string|\Stringable $message, array $context = []);
6767

6868
/**
6969
* Exceptional occurrences that are not errors.
7070
*
7171
* Example: Use of deprecated APIs, poor use of an API, undesirable things
7272
* that are not necessarily wrong.
7373
*
74-
* @param string $message
74+
* @param string|\Stringable $message
7575
* @param mixed[] $context
7676
*
7777
* @return void
7878
*/
79-
public function warning($message, array $context = array());
79+
public function warning(string|\Stringable $message, array $context = []);
8080

8181
/**
8282
* Normal but significant events.
8383
*
84-
* @param string $message
84+
* @param string|\Stringable $message
8585
* @param mixed[] $context
8686
*
8787
* @return void
8888
*/
89-
public function notice($message, array $context = array());
89+
public function notice(string|\Stringable $message, array $context = []);
9090

9191
/**
9292
* Interesting events.
9393
*
9494
* Example: User logs in, SQL logs.
9595
*
96-
* @param string $message
96+
* @param string|\Stringable $message
9797
* @param mixed[] $context
9898
*
9999
* @return void
100100
*/
101-
public function info($message, array $context = array());
101+
public function info(string|\Stringable $message, array $context = []);
102102

103103
/**
104104
* Detailed debug information.
105105
*
106-
* @param string $message
106+
* @param string|\Stringable $message
107107
* @param mixed[] $context
108108
*
109109
* @return void
110110
*/
111-
public function debug($message, array $context = array());
111+
public function debug(string|\Stringable $message, array $context = []);
112112

113113
/**
114114
* Logs with an arbitrary level.
115115
*
116116
* @param mixed $level
117-
* @param string $message
117+
* @param string|\Stringable $message
118118
* @param mixed[] $context
119119
*
120120
* @return void
121121
*
122122
* @throws \Psr\Log\InvalidArgumentException
123123
*/
124-
public function log($level, $message, array $context = array());
124+
public function log($level, string|\Stringable $message, array $context = []);
125125
}

0 commit comments

Comments
 (0)