Completed
Push — master ( 4acd9a...22743d )
by Nikola
01:08
created

BaseConfig::defaults()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MonologFactory\Config;
6
7
use MonologFactory\Exception\InvalidConfig;
8
9
abstract class BaseConfig
10
{
11
    /**
12
     * @throws InvalidConfig
13
     */
14 21
    final protected static function filter(array $config): array
15
    {
16 21
        $config = array_merge(static::defaults(), $config);
17
18 21
        static::validate($config);
19
20 17
        return $config;
21
    }
22
23
    abstract protected static function defaults(): array;
24
25
    /**
26
     * @throws InvalidConfig
27
     */
28
    abstract protected static function validate(array $config): void;
29
}
30