Skip to content

Commit e6c912c

Browse files
committed
Drop LoggerAttachment, use closures instead
1 parent 172de7e commit e6c912c

File tree

2 files changed

+9
-33
lines changed

2 files changed

+9
-33
lines changed

src/AttachableLogger.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,33 @@
1515
* GNU General Public License for more details.
1616
*/
1717

18+
/**
19+
* @phpstan-type LoggerAttachment \Closure(mixed $level, string $message) : void
20+
*/
1821
interface AttachableLogger extends \Logger{
1922

2023
/**
21-
* @param LoggerAttachment $attachment
24+
* @phpstan-param LoggerAttachment $attachment
2225
*
2326
* @return void
2427
*/
25-
public function addAttachment(\LoggerAttachment $attachment);
28+
public function addAttachment(\Closure $attachment);
2629

2730
/**
28-
* @param LoggerAttachment $attachment
31+
* @phpstan-param LoggerAttachment $attachment
2932
*
3033
* @return void
3134
*/
32-
public function removeAttachment(\LoggerAttachment $attachment);
35+
public function removeAttachment(\Closure $attachment);
3336

3437
/**
3538
* @return void
3639
*/
3740
public function removeAttachments();
3841

3942
/**
40-
* @return \LoggerAttachment[]
43+
* @return \Closure[]
44+
* @phpstan-return LoggerAttachment[]
4145
*/
4246
public function getAttachments();
4347
}

src/LoggerAttachment.php

-28
This file was deleted.

0 commit comments

Comments
 (0)