Skip to content

Commit 18e2f08

Browse files
authored
Formatting cleanup, remove obsolete stub and add .editorconfig (#1)
1 parent f29eb41 commit 18e2f08

11 files changed

+512
-785
lines changed

.editorconfig

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# http://editorconfig.org/
2+
root = yes
3+
4+
[*]
5+
indent_size = 4
6+
indent_style = tab

AttachableLogger.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717

1818
interface AttachableLogger extends \Logger{
1919

20-
/**
21-
* @param LoggerAttachment $attachment
22-
*/
23-
public function addAttachment(\LoggerAttachment $attachment);
20+
/**
21+
* @param LoggerAttachment $attachment
22+
*/
23+
public function addAttachment(\LoggerAttachment $attachment);
2424

25-
/**
26-
* @param LoggerAttachment $attachment
27-
*/
28-
public function removeAttachment(\LoggerAttachment $attachment);
25+
/**
26+
* @param LoggerAttachment $attachment
27+
*/
28+
public function removeAttachment(\LoggerAttachment $attachment);
2929

30-
public function removeAttachments();
30+
public function removeAttachments();
3131

32-
/**
33-
* @return \LoggerAttachment[]
34-
*/
35-
public function getAttachments();
32+
/**
33+
* @return \LoggerAttachment[]
34+
*/
35+
public function getAttachments();
3636
}

AttachableThreadedLogger.php

+42-42
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,51 @@
1717

1818
abstract class AttachableThreadedLogger extends \ThreadedLogger{
1919

20-
/** @var \ThreadedLoggerAttachment */
21-
protected $attachment = null;
20+
/** @var \ThreadedLoggerAttachment */
21+
protected $attachment = null;
2222

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+
}
3333

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+
}
4747

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+
}
5454

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+
}
6464

65-
return $attachments;
66-
}
65+
return $attachments;
66+
}
6767
}

0 commit comments

Comments
 (0)