5353use Throwable ;
5454
5555/**
56- * Class AbstractFormatter
56+ * @class AbstractFormatter
5757 * @package Platine\Logger\Formatter
5858 */
5959abstract class AbstractFormatter implements LoggerFormatterInterface
@@ -64,25 +64,18 @@ abstract class AbstractFormatter implements LoggerFormatterInterface
6464 */
6565 protected string $ tab = "\t" ;
6666
67- /**
68- * The configuration to use
69- * @var Configuration
70- */
71- protected Configuration $ config ;
72-
7367 /**
7468 * Create new instance
7569 * @param Configuration $config the configuration to use
7670 */
77- public function __construct (Configuration $ config )
71+ public function __construct (protected Configuration $ config )
7872 {
79- $ this ->config = $ config ;
8073 }
8174
8275 /**
8376 * Get Exception information data
8477 * @param Throwable $exception
85- * @return array<string, mixed> the exception data
78+ * @return array<string, mixed> the exception data
8679 */
8780 protected function getExceptionData (Throwable $ exception ): array
8881 {
@@ -102,7 +95,7 @@ protected function getExceptionData(Throwable $exception): array
10295 $ trace ['file ' ] ?? '' ,
10396 $ trace ['class ' ] ?? '' ,
10497 $ trace ['type ' ] ?? '' ,
105- $ trace ['function ' ] ?? '' ,
98+ $ trace ['function ' ],
10699 isset ($ trace ['args ' ]) ? '... ' : '' ,
107100 $ trace ['line ' ] ?? ''
108101 ) . "\n" ;
@@ -143,7 +136,7 @@ protected function interpolate(string $message, array $context): string
143136 protected function getLogTime (): string
144137 {
145138 $ format = 'Y-m-d H:i:s.u ' ;
146- $ useTimestamp = $ this ->config ->get ('timestamp ' , false );
139+ $ useTimestamp = $ this ->config ->get ('timestamp ' );
147140 if ($ useTimestamp === false ) {
148141 $ format = 'H:i:s.u ' ;
149142 }
0 commit comments