Passed
Push — master ( f946ea...c739e9 )
by Daimona
02:07
created
includes/Logger/SimpleLogger.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Logger;
4 4
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	/**
18 18
 	 * @param string $minlevel
19 19
 	 */
20
-	public function __construct( $minlevel = LogLevel::INFO ) {
20
+	public function __construct ( $minlevel = LogLevel::INFO ) {
21 21
 		$this->minLevel = $this->levelToInt( $minlevel );
22 22
 	}
23 23
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * @inheritDoc
26 26
 	 * @suppress PhanUnusedPublicMethodParameter
27 27
 	 */
28
-	public function log( $level, $message, array $context = [] ) {
28
+	public function log ( $level, $message, array $context = [ ] ) {
29 29
 		if ( $this->levelToInt( $level ) >= $this->minLevel ) {
30 30
 			echo $this->getFormattedMessage( $level, $message );
31 31
 		}
Please login to merge, or discard this patch.
includes/Logger/MultiLogger.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Logger;
4 4
 
@@ -10,12 +10,12 @@  discard block
 block discarded – undo
10 10
  */
11 11
 class MultiLogger extends AbstractLogger {
12 12
 	/** @var LoggerInterface[] */
13
-	private $loggers = [];
13
+	private $loggers = [ ];
14 14
 
15 15
 	/**
16 16
 	 * @param LoggerInterface ...$loggers
17 17
 	 */
18
-	public function __construct( LoggerInterface ...$loggers ) {
18
+	public function __construct ( LoggerInterface ...$loggers ) {
19 19
 		$this->loggers = $loggers;
20 20
 	}
21 21
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 * @inheritDoc
24 24
 	 * @suppress PhanUnusedPublicMethodParameter
25 25
 	 */
26
-	public function log( $level, $message, array $context = [] ) {
26
+	public function log ( $level, $message, array $context = [ ] ) {
27 27
 		foreach ( $this->loggers as $logger ) {
28 28
 			$logger->log( $level, $message );
29 29
 		}
Please login to merge, or discard this patch.
includes/Logger/LoggerTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Logger;
4 4
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 	 * @param string $level
12 12
 	 * @return int
13 13
 	 */
14
-	protected function levelToInt( string $level ) : int {
14
+	protected function levelToInt ( string $level ) : int {
15 15
 		// Order matters
16 16
 		$mapping = [
17 17
 			LogLevel::DEBUG,
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @param string $message
32 32
 	 * @return string
33 33
 	 */
34
-	protected function getFormattedMessage( string $level, string $message ) {
34
+	protected function getFormattedMessage ( string $level, string $message ) {
35 35
 		return sprintf( "%s [%s] - %s\n", date( 'd M H:i:s' ), $level, $message );
36 36
 	}
37 37
 }
Please login to merge, or discard this patch.
includes/Logger/WikiLogger.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Logger;
4 4
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @param Page $logPage
27 27
 	 * @param string $minlevel
28 28
 	 */
29
-	public function __construct( Page $logPage, $minlevel = LogLevel::INFO ) {
29
+	public function __construct ( Page $logPage, $minlevel = LogLevel::INFO ) {
30 30
 		$this->logPage = $logPage;
31 31
 		$this->minLevel = $this->levelToInt( $minlevel );
32 32
 	}
@@ -35,16 +35,16 @@  discard block
 block discarded – undo
35 35
 	 * @inheritDoc
36 36
 	 * @suppress PhanUnusedPublicMethodParameter
37 37
 	 */
38
-	public function log( $level, $message, array $context = [] ) {
38
+	public function log ( $level, $message, array $context = [ ] ) {
39 39
 		if ( $this->levelToInt( $level ) >= $this->minLevel ) {
40
-			$this->buffer[] = $this->getFormattedMessage( $level, $message );
40
+			$this->buffer[ ] = $this->getFormattedMessage( $level, $message );
41 41
 		}
42 42
 	}
43 43
 
44 44
 	/**
45 45
 	 * Actually writes data to the wiki
46 46
 	 */
47
-	public function doOutput() {
47
+	public function doOutput () {
48 48
 		if ( $this->buffer ) {
49 49
 			$this->logPage->edit( [
50 50
 				'appendtext' => implode( "\n", $this->buffer ),
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	/**
57 57
 	 * @todo Can we move this?
58 58
 	 */
59
-	public function __destruct() {
59
+	public function __destruct () {
60 60
 		$this->doOutput();
61 61
 	}
62 62
 }
Please login to merge, or discard this patch.