Completed
Push — master ( ca59bb...88087c )
by smiley
08:06
created
src/Output/LogOutputAbstract.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,18 +18,18 @@  discard block
 block discarded – undo
18 18
 /**
19 19
  *
20 20
  */
21
-abstract class LogOutputAbstract implements LogOutputInterface{
21
+abstract class LogOutputAbstract implements LogOutputInterface {
22 22
 
23 23
 	/**
24 24
 	 * @var \chillerlan\Logger\LogOptions
25 25
 	 */
26 26
 	protected $options;
27 27
 
28
-	public function __construct(ContainerInterface $options = null){
28
+	public function __construct(ContainerInterface $options = null) {
29 29
 		$this->options = $options ?? new LogOptions;
30 30
 	}
31 31
 
32
-	public function __destruct(){
32
+	public function __destruct() {
33 33
 		$this->close();
34 34
 	}
35 35
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 	abstract protected function __log(string $level, string $message, array $context = null);
41 41
 
42
-	public function log(string $level, string $message, array $context = null){ // @todo: loglevel bitmask
43
-		if((array_key_exists($level, $this::LEVELS) && $this::LEVELS[$level] >= $this::LEVELS[$this->options->minLogLevel]) || (!array_key_exists($level, $this::LEVELS) && !empty($level))){
42
+	public function log(string $level, string $message, array $context = null) { // @todo: loglevel bitmask
43
+		if ((array_key_exists($level, $this::LEVELS) && $this::LEVELS[$level] >= $this::LEVELS[$this->options->minLogLevel]) || (!array_key_exists($level, $this::LEVELS) && !empty($level))) {
44 44
 			$this->__log($level, $message, $context);
45 45
 		}
46 46
 	}
Please login to merge, or discard this patch.
src/LogTrait.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  * @implements \Psr\Log\LoggerAwareInterface
20 20
  * @implements \Psr\Log\LoggerInterface
21 21
  */
22
-trait LogTrait{
22
+trait LogTrait {
23 23
 
24 24
 	/**
25 25
 	 * @var \Psr\Log\LoggerInterface
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 *
34 34
 	 * @return void
35 35
 	 */
36
-	public function setLogger(LoggerInterface $logger){
36
+	public function setLogger(LoggerInterface $logger) {
37 37
 		$this->log = $logger;
38 38
 	}
39 39
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 *
47 47
 	 * @return void
48 48
 	 */
49
-	protected function log($level, $message, array $context = null){
49
+	protected function log($level, $message, array $context = null) {
50 50
 		$this->log->log($level, $message, $context ?? []);
51 51
 	}
52 52
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 *
59 59
 	 * @return void
60 60
 	 */
61
-	protected function emergency($message, array $context = null){
61
+	protected function emergency($message, array $context = null) {
62 62
 		$this->log->emergency($message, $context);
63 63
 	}
64 64
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 *
74 74
 	 * @return void
75 75
 	 */
76
-	protected function alert($message, array $context = null){
76
+	protected function alert($message, array $context = null) {
77 77
 		$this->log->alert($message, $context);
78 78
 	}
79 79
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 *
88 88
 	 * @return void
89 89
 	 */
90
-	protected function critical($message, array $context = null){
90
+	protected function critical($message, array $context = null) {
91 91
 		$this->log->critical($message, $context);
92 92
 	}
93 93
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 *
101 101
 	 * @return void
102 102
 	 */
103
-	protected function error($message, array $context = null){
103
+	protected function error($message, array $context = null) {
104 104
 		$this->log->error($message, $context);
105 105
 	}
106 106
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 *
116 116
 	 * @return void
117 117
 	 */
118
-	protected function warning($message, array $context = null){
118
+	protected function warning($message, array $context = null) {
119 119
 		$this->log->warning($message, $context);
120 120
 	}
121 121
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 *
128 128
 	 * @return void
129 129
 	 */
130
-	protected function notice($message, array $context = null){
130
+	protected function notice($message, array $context = null) {
131 131
 		$this->log->notice($message, $context);
132 132
 	}
133 133
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 *
142 142
 	 * @return void
143 143
 	 */
144
-	protected function info($message, array $context = null){
144
+	protected function info($message, array $context = null) {
145 145
 		$this->log->info($message, $context);
146 146
 	}
147 147
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 *
154 154
 	 * @return void
155 155
 	 */
156
-	protected function debug($message, array $context = null){
156
+	protected function debug($message, array $context = null) {
157 157
 		$this->log->debug($message, $context);
158 158
 	}
159 159
 
Please login to merge, or discard this patch.