@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare( strict_types=1 ); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace BotRiconferme\Logger; |
4 | 4 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string $summary |
30 | 30 | * @param string $minlevel |
31 | 31 | */ |
32 | - public function __construct( Page $logPage, string $summary, $minlevel = LogLevel::INFO ) { |
|
32 | + public function __construct ( Page $logPage, string $summary, $minlevel = LogLevel::INFO ) { |
|
33 | 33 | $this->minLevel = $this->levelToInt( $minlevel ); |
34 | 34 | $this->logPage = $logPage; |
35 | 35 | $this->summary = $summary; |
@@ -40,16 +40,16 @@ discard block |
||
40 | 40 | * @param mixed[] $context |
41 | 41 | * @suppress PhanUnusedPublicMethodParameter |
42 | 42 | */ |
43 | - public function log( $level, $message, array $context = [] ) :void { |
|
43 | + public function log ( $level, $message, array $context = [ ] ) :void { |
|
44 | 44 | if ( $this->levelToInt( $level ) >= $this->minLevel ) { |
45 | - $this->buffer[] = $this->getFormattedMessage( $level, $message ); |
|
45 | + $this->buffer[ ] = $this->getFormattedMessage( $level, $message ); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | 50 | * @return string |
51 | 51 | */ |
52 | - protected function getOutput() : string { |
|
52 | + protected function getOutput () : string { |
|
53 | 53 | $line = str_repeat( '-', 80 ); |
54 | 54 | return "\n\n" . implode( "\n", $this->buffer ) . "\n$line\n\n"; |
55 | 55 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * @inheritDoc |
59 | 59 | */ |
60 | - public function flush() : void { |
|
60 | + public function flush () : void { |
|
61 | 61 | if ( $this->buffer ) { |
62 | 62 | $this->logPage->edit( [ |
63 | 63 | 'appendtext' => $this->getOutput(), |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare( strict_types=1 ); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace BotRiconferme\Logger; |
4 | 4 | |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * @param IFlushingAwareLogger ...$loggers |
16 | 16 | */ |
17 | - public function __construct( IFlushingAwareLogger ...$loggers ) { |
|
17 | + public function __construct ( IFlushingAwareLogger ...$loggers ) { |
|
18 | 18 | $this->loggers = $loggers; |
19 | 19 | } |
20 | 20 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @param mixed[] $context |
24 | 24 | * @suppress PhanUnusedPublicMethodParameter |
25 | 25 | */ |
26 | - public function log( $level, $message, array $context = [] ) :void { |
|
26 | + public function log ( $level, $message, array $context = [ ] ) :void { |
|
27 | 27 | foreach ( $this->loggers as $logger ) { |
28 | 28 | $logger->log( $level, $message ); |
29 | 29 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * @inheritDoc |
34 | 34 | */ |
35 | - public function flush() : void { |
|
35 | + public function flush () : void { |
|
36 | 36 | foreach ( $this->loggers as $logger ) { |
37 | 37 | $logger->flush(); |
38 | 38 | } |
@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @param mixed[] $context |
27 | 27 | * @suppress PhanUnusedPublicMethodParameter |
28 | 28 | */ |
29 | - public function log( $level, $message, array $context = [] ) : void { |
|
29 | + public function log ( $level, $message, array $context = [ ] ) : void { |
|
30 | 30 | if ( $this->levelToInt( $level ) >= $this->minLevel ) { |
31 | 31 | echo $this->getFormattedMessage( $level, $message ) . "\n"; |
32 | 32 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | /** |
36 | 36 | * @inheritDoc |
37 | 37 | */ |
38 | - public function flush() : void { |
|
38 | + public function flush () : void { |
|
39 | 39 | // Everything else is printed immediately |
40 | 40 | echo "\n" . str_repeat( '-', 80 ) . "\n\n"; |
41 | 41 | } |