File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,28 +65,23 @@ class Log implements Logger
6565 use LoggerTrait;
6666
6767 private const DATE_FORMAT = 'd/m/Y H:i:s.u ' ;
68-
6968 private DateTimeZone $ timezone ;
7069
71- /**
72- * @var array<int, Processor> Hash with all registered log processors.
73- */
74- private array $ processors = [];
75-
7670 /**
7771 * Creates all requested log processors.
7872 *
79- * @param array $processors a list of log processors
73+ * @param array<int, Processor> $processors a list of log processors
8074 * @param string $dateformat The date format for the messages
8175 * @param string $timezone The timezone for the messages
8276 */
8377 public function __construct (
84- array $ processors ,
78+ private array $ processors = [] ,
8579 private string $ dateformat = self ::DATE_FORMAT ,
8680 string $ timezone = 'UTC ' )
8781 {
8882 $ this ->timezone = @timezone_open ($ timezone ) ?: timezone_open ('UTC ' );
89- foreach ($ processors as $ processor ) {
83+ foreach ($ processors as $ i => $ processor ) {
84+ unset($ this ->processors [$ i ]);
9085 $ this ->attach (new $ processor ['class ' ]($ processor ));
9186 }
9287 }
You can’t perform that action at this time.
0 commit comments