Passed
Branch master (5c167b)
by smiley
02:26
created
src/LogOptions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
  * @property string $consoleFormat
21 21
  * @property string $consoleDateFormat
22 22
  */
23
-class LogOptions{
23
+class LogOptions {
24 24
 	use Container;
25 25
 
26 26
 	/**
Please login to merge, or discard this patch.
src/LogTrait.php 1 patch
Spacing   +12 added lines, -12 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,9 +46,9 @@  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
 
51
-		if($this->log instanceof LoggerInterface){
51
+		if ($this->log instanceof LoggerInterface) {
52 52
 			$this->log->log($level, $message, $context ?? []);
53 53
 		}
54 54
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @return void
64 64
 	 */
65
-	protected function emergency($message, array $context = null){
65
+	protected function emergency($message, array $context = null) {
66 66
 		$this->log(LogLevel::EMERGENCY, $message, $context);
67 67
 	}
68 68
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 *
78 78
 	 * @return void
79 79
 	 */
80
-	protected function alert($message, array $context = null){
80
+	protected function alert($message, array $context = null) {
81 81
 		$this->log(LogLevel::ALERT, $message, $context);
82 82
 	}
83 83
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 *
92 92
 	 * @return void
93 93
 	 */
94
-	protected function critical($message, array $context = null){
94
+	protected function critical($message, array $context = null) {
95 95
 		$this->log(LogLevel::CRITICAL, $message, $context);
96 96
 	}
97 97
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 *
105 105
 	 * @return void
106 106
 	 */
107
-	protected function error($message, array $context = null){
107
+	protected function error($message, array $context = null) {
108 108
 		$this->log(LogLevel::ERROR, $message, $context);
109 109
 	}
110 110
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 *
120 120
 	 * @return void
121 121
 	 */
122
-	protected function warning($message, array $context = null){
122
+	protected function warning($message, array $context = null) {
123 123
 		$this->log(LogLevel::WARNING, $message, $context);
124 124
 	}
125 125
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 *
132 132
 	 * @return void
133 133
 	 */
134
-	protected function notice($message, array $context = null){
134
+	protected function notice($message, array $context = null) {
135 135
 		$this->log(LogLevel::NOTICE, $message, $context);
136 136
 	}
137 137
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 *
146 146
 	 * @return void
147 147
 	 */
148
-	protected function info($message, array $context = null){
148
+	protected function info($message, array $context = null) {
149 149
 		$this->log(LogLevel::INFO, $message, $context);
150 150
 	}
151 151
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 *
158 158
 	 * @return void
159 159
 	 */
160
-	protected function debug($message, array $context = null){
160
+	protected function debug($message, array $context = null) {
161 161
 		$this->log(LogLevel::DEBUG, $message, $context);
162 162
 	}
163 163
 
Please login to merge, or discard this patch.
src/Log.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 /**
19 19
  */
20
-class Log implements LoggerInterface{
20
+class Log implements LoggerInterface {
21 21
 
22 22
 	/**
23 23
 	 * @var \chillerlan\Logger\LogOptions
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	/**
33 33
 	 *
34 34
 	 */
35
-	public function __destruct(){
35
+	public function __destruct() {
36 36
 		$this->close();
37 37
 	}
38 38
 
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function close():Log{
45 45
 
46
-		if(!empty($this->instances)){
47
-			foreach($this->instances as $instanceName => $instance){
46
+		if (!empty($this->instances)) {
47
+			foreach ($this->instances as $instanceName => $instance) {
48 48
 				unset($this->instances[$instanceName]);
49 49
 			}
50 50
 		}
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function getInstance(string $instanceName):LogOutputInterface{
74 74
 
75
-		if(!array_key_exists($instanceName, $this->instances)){
75
+		if (!array_key_exists($instanceName, $this->instances)) {
76 76
 			throw new LogException('invalid logger instance: '.$instanceName);
77 77
 		}
78 78
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function removeInstance(string $instanceName):Log{
89 89
 
90
-		if(!array_key_exists($instanceName, $this->instances)){
90
+		if (!array_key_exists($instanceName, $this->instances)) {
91 91
 			throw new LogException('invalid logger instance: '.$instanceName);
92 92
 		}
93 93
 
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 	 *
106 106
 	 * @return void
107 107
 	 */
108
-	public function log($level, $message, array $context = []){
108
+	public function log($level, $message, array $context = []) {
109 109
 
110
-		foreach($this->instances as $logger){
110
+		foreach ($this->instances as $logger) {
111 111
 			$logger->log($level, $message, $context);
112 112
 		}
113 113
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 *
122 122
 	 * @return void
123 123
 	 */
124
-	public function emergency($message, array $context = []){
124
+	public function emergency($message, array $context = []) {
125 125
 		$this->log(LogLevel::EMERGENCY, $message, $context);
126 126
 	}
127 127
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 *
137 137
 	 * @return void
138 138
 	 */
139
-	public function alert($message, array $context = []){
139
+	public function alert($message, array $context = []) {
140 140
 		$this->log(LogLevel::ALERT, $message, $context);
141 141
 	}
142 142
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	 *
151 151
 	 * @return void
152 152
 	 */
153
-	public function critical($message, array $context = []){
153
+	public function critical($message, array $context = []) {
154 154
 		$this->log(LogLevel::CRITICAL, $message, $context);
155 155
 	}
156 156
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 *
164 164
 	 * @return void
165 165
 	 */
166
-	public function error($message, array $context = []){
166
+	public function error($message, array $context = []) {
167 167
 		$this->log(LogLevel::ERROR, $message, $context);
168 168
 	}
169 169
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	 *
179 179
 	 * @return void
180 180
 	 */
181
-	public function warning($message, array $context = []){
181
+	public function warning($message, array $context = []) {
182 182
 		$this->log(LogLevel::WARNING, $message, $context);
183 183
 	}
184 184
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 *
191 191
 	 * @return void
192 192
 	 */
193
-	public function notice($message, array $context = []){
193
+	public function notice($message, array $context = []) {
194 194
 		$this->log(LogLevel::NOTICE, $message, $context);
195 195
 	}
196 196
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	 *
205 205
 	 * @return void
206 206
 	 */
207
-	public function info($message, array $context = []){
207
+	public function info($message, array $context = []) {
208 208
 		$this->log(LogLevel::INFO, $message, $context);
209 209
 	}
210 210
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 *
217 217
 	 * @return void
218 218
 	 */
219
-	public function debug($message, array $context = []){
219
+	public function debug($message, array $context = []) {
220 220
 		$this->log(LogLevel::DEBUG, $message, $context);
221 221
 	}
222 222
 
Please login to merge, or discard this patch.
src/Output/Logfile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@
 block discarded – undo
14 14
 
15 15
 /**
16 16
  */
17
-class Logfile extends ConsoleLog{
17
+class Logfile extends ConsoleLog {
18 18
 
19
-	protected function __log(string $level, string $message, array $context = null){
19
+	protected function __log(string $level, string $message, array $context = null) {
20 20
 		$data = $this->message($level, $message, $context);
21 21
 		// ... @todo
22 22
 	}
Please login to merge, or discard this patch.
src/Output/LogOutputInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
 /**
18 18
  */
19
-interface LogOutputInterface{
19
+interface LogOutputInterface {
20 20
 
21 21
 	const E_NULL      = 0x00;
22 22
 	const E_ALL       = 0xff;
Please login to merge, or discard this patch.
src/Output/EmailLog.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 /**
19 19
  */
20
-class EmailLog extends LogOutputAbstract{
20
+class EmailLog extends LogOutputAbstract {
21 21
 
22 22
 	protected $mailer;
23 23
 
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 	 * @param \chillerlan\Logger\LogOptions $options
29 29
 	 * @param \PHPMailer\PHPMailer\PHPMailer     $mailer
30 30
 	 */
31
-	public function __construct(LogOptions $options, PHPMailer $mailer){
31
+	public function __construct(LogOptions $options, PHPMailer $mailer) {
32 32
 		$this->options = $options;
33 33
 		$this->mailer  = $mailer;
34 34
 	}
35 35
 
36
-	protected function __log(string $level, string $message, array $context = null){
36
+	protected function __log(string $level, string $message, array $context = null) {
37 37
 		// TODO: Implement log() method.
38 38
 	}
39 39
 
Please login to merge, or discard this patch.
src/Output/ServerErrorlog.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@
 block discarded – undo
14 14
 
15 15
 /**
16 16
  */
17
-class ServerErrorlog extends LogOutputAbstract{
17
+class ServerErrorlog extends LogOutputAbstract {
18 18
 
19
-	protected function __log(string $level, string $message, array $context = null){
19
+	protected function __log(string $level, string $message, array $context = null) {
20 20
 		// TODO: Implement log() method.
21 21
 	}
22 22
 
Please login to merge, or discard this patch.
src/Output/NullLogger.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
  * is a good way to avoid littering your code with `if ($this->logger) { }`
21 21
  * blocks.
22 22
  */
23
-class NullLogger extends LogOutputAbstract{
23
+class NullLogger extends LogOutputAbstract {
24 24
 
25
-	protected function __log(string $level, string $message, array $context = null){
25
+	protected function __log(string $level, string $message, array $context = null) {
26 26
 		// go along, nothing to see here.
27 27
 	}
28 28
 
Please login to merge, or discard this patch.
src/Output/DatabaseLog.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 /**
19 19
  */
20
-class DatabaseLog extends LogOutputAbstract{
20
+class DatabaseLog extends LogOutputAbstract {
21 21
 
22 22
 	/**
23 23
 	 * @var \chillerlan\Database\Connection
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 	 * @param \chillerlan\Logger\LogOptions $options
32 32
 	 * @param \chillerlan\Database\Connection    $db
33 33
 	 */
34
-	public function __construct(LogOptions $options, Connection $db){
34
+	public function __construct(LogOptions $options, Connection $db) {
35 35
 		$this->options = $options;
36 36
 		$this->db      = $db;
37 37
 
38 38
 		$this->db->connect();
39 39
 	}
40 40
 
41
-	protected function __log(string $level, string $message, array $context = null){
41
+	protected function __log(string $level, string $message, array $context = null) {
42 42
 		// TODO: Implement log() method.
43 43
 	}
44 44
 }
Please login to merge, or discard this patch.