| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class LoggerConfig implements ConfigInterface |
||
| 8 | { |
||
| 9 | public function __construct( |
||
| 10 | public bool $enable = false, |
||
| 11 | public string $file = './logs/pay.log', |
||
| 12 | public string $level = 'info', |
||
| 13 | public string $type = 'single', |
||
| 14 | public int $max_file = 30, |
||
| 15 | ) { |
||
| 16 | } |
||
| 17 | |||
| 18 | public function toArray(): array |
||
| 19 | { |
||
| 20 | return [ |
||
| 21 | 'enable' => $this->enable, |
||
| 22 | 'file' => $this->file, |
||
| 23 | 'level' => $this->level, |
||
| 24 | 'type' => $this->type, |
||
| 25 | 'max_file' => $this->max_file, |
||
| 26 | ]; |
||
| 27 | } |
||
| 28 | |||
| 29 | public static function fromArray(array $config): self |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |