17
17
18
18
abstract class AttachableThreadedLogger extends \ThreadedLogger{
19
19
20
- /** @var \ThreadedLoggerAttachment */
21
- protected $ attachment = null ;
20
+ /** @var \ThreadedLoggerAttachment */
21
+ protected $ attachment = null ;
22
22
23
- /**
24
- * @param ThreadedLoggerAttachment $attachment
25
- */
26
- public function addAttachment (\ThreadedLoggerAttachment $ attachment ){
27
- if ($ this ->attachment instanceof \ThreadedLoggerAttachment){
28
- $ this ->attachment ->addAttachment ($ attachment );
29
- }else {
30
- $ this ->attachment = $ attachment ;
31
- }
32
- }
23
+ /**
24
+ * @param ThreadedLoggerAttachment $attachment
25
+ */
26
+ public function addAttachment (\ThreadedLoggerAttachment $ attachment ){
27
+ if ($ this ->attachment instanceof \ThreadedLoggerAttachment){
28
+ $ this ->attachment ->addAttachment ($ attachment );
29
+ }else {
30
+ $ this ->attachment = $ attachment ;
31
+ }
32
+ }
33
33
34
- /**
35
- * @param ThreadedLoggerAttachment $attachment
36
- */
37
- public function removeAttachment (\ThreadedLoggerAttachment $ attachment ){
38
- if ($ this ->attachment instanceof \ThreadedLoggerAttachment){
39
- if ($ this ->attachment === $ attachment ){
40
- $ this ->attachment = null ;
41
- foreach ($ attachment ->getAttachments () as $ attachment ){
42
- $ this ->addAttachment ($ attachment );
43
- }
44
- }
45
- }
46
- }
34
+ /**
35
+ * @param ThreadedLoggerAttachment $attachment
36
+ */
37
+ public function removeAttachment (\ThreadedLoggerAttachment $ attachment ){
38
+ if ($ this ->attachment instanceof \ThreadedLoggerAttachment){
39
+ if ($ this ->attachment === $ attachment ){
40
+ $ this ->attachment = null ;
41
+ foreach ($ attachment ->getAttachments () as $ attachment ){
42
+ $ this ->addAttachment ($ attachment );
43
+ }
44
+ }
45
+ }
46
+ }
47
47
48
- public function removeAttachments (){
49
- if ($ this ->attachment instanceof \ThreadedLoggerAttachment){
50
- $ this ->attachment ->removeAttachments ();
51
- $ this ->attachment = null ;
52
- }
53
- }
48
+ public function removeAttachments (){
49
+ if ($ this ->attachment instanceof \ThreadedLoggerAttachment){
50
+ $ this ->attachment ->removeAttachments ();
51
+ $ this ->attachment = null ;
52
+ }
53
+ }
54
54
55
- /**
56
- * @return \ThreadedLoggerAttachment[]
57
- */
58
- public function getAttachments (){
59
- $ attachments = [];
60
- if ($ this ->attachment instanceof \ThreadedLoggerAttachment){
61
- $ attachments [] = $ this ->attachment ;
62
- $ attachments += $ this ->attachment ->getAttachments ();
63
- }
55
+ /**
56
+ * @return \ThreadedLoggerAttachment[]
57
+ */
58
+ public function getAttachments (){
59
+ $ attachments = [];
60
+ if ($ this ->attachment instanceof \ThreadedLoggerAttachment){
61
+ $ attachments [] = $ this ->attachment ;
62
+ $ attachments += $ this ->attachment ->getAttachments ();
63
+ }
64
64
65
- return $ attachments ;
66
- }
65
+ return $ attachments ;
66
+ }
67
67
}
0 commit comments