HandlerStreamConfiguration::useLocking()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
/*
4
 *  This file is part of the Micro framework package.
5
 *
6
 *  (c) Stanislau Komar <[email protected]>
7
 *
8
 *  For the full copyright and license information, please view the LICENSE
9
 *  file that was distributed with this source code.
10
 */
11
12
namespace Micro\Plugin\Logger\Monolog\Configuration\Handler\Type;
13
14
use Micro\Plugin\Logger\Monolog\Business\Handler\Type\Stream\StreamHandler;
15
use Micro\Plugin\Logger\Monolog\Configuration\Handler\HandlerConfiguration;
16
17
class HandlerStreamConfiguration extends HandlerConfiguration implements HandlerStreamConfigurationInterface
18
{
19
    protected const CFG_LOG_FILE = 'LOGGER_%s_FILE';
20
    protected const CFG_USE_LOCKING = 'LOGGER_%s_USE_LOCKING';
21
22
    /**
23
     * {@inheritDoc}
24
     */
25 2
    public function getLogFile(): string
26
    {
27 2
        return $this->get(
28 2
            self::CFG_LOG_FILE,
29 2
            $this->configuration->get('BASE_PATH').'/var/log/micro/app.log'
30 2
        );
31
    }
32
33
    /**
34
     * {@inheritDoc}
35
     */
36 2
    public function useLocking(): bool
37
    {
38 2
        return $this->get(self::CFG_USE_LOCKING, false);
39
    }
40
41 1
    public static function type(): string
42
    {
43 1
        return self::TYPE;
44
    }
45
46 1
    public function getHandlerClassName(): string
47
    {
48 1
        return StreamHandler::class;
49
    }
50
}
51