Passed
Push — master ( 88087c...22d0de )
by smiley
01:43
created
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.
src/Output/Syslog.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 /**
18 18
  */
19
-class Syslog extends LogOutputAbstract{
19
+class Syslog extends LogOutputAbstract {
20 20
 
21 21
 	const syslogLevels = [
22 22
 		LogLevel::DEBUG     => LOG_DEBUG,
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		LogLevel::EMERGENCY => LOG_EMERG,
30 30
 	];
31 31
 
32
-	protected function __log(string $level, string $message, array $context = null){
32
+	protected function __log(string $level, string $message, array $context = null) {
33 33
 		syslog($this::syslogLevels[$level], $message);
34 34
 	}
35 35
 
Please login to merge, or discard this patch.
src/Output/ConsoleLog.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
 
15 15
 /**
16 16
  */
17
-class ConsoleLog extends LogOutputAbstract{
17
+class ConsoleLog 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
 		echo $this->message($level, $message, $context);
21 21
 	}
22 22
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		return $this;
27 27
 	}
28 28
 
29
-	protected function message(string $level, string $message, array $context = null){
29
+	protected function message(string $level, string $message, array $context = null) {
30 30
 		return sprintf($this->options->consoleFormat, date($this->options->consoleDateFormat), $level, $message).PHP_EOL;
31 31
 	}
32 32
 }
Please login to merge, or discard this patch.