Passed
Pull Request — master (#149)
by Tobias
02:38 queued 27s
created

AdaptiveHandler::write()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of Ekino New Relic bundle.
5
 *
6
 * (c) Ekino - Thomas Rabaix <[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 Ekino\Bundle\NewRelicBundle\Logging;
13
14
use Monolog\Handler\NewRelicHandler;
15
use Psr\Log\LogLevel;
16
17
class AdaptiveHandler extends NewRelicHandler
18
{
19
    public function __construct(
20
        $level = LogLevel::ERROR,
21
        $bubble = true,
22
        $appName = null,
23
        $explodeArrays = false,
24
        $transactionName = null
25
    ) {
26
        parent::__construct($level, $bubble, $appName, $explodeArrays, $transactionName);
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    protected function write(array $record)
33
    {
34
        if (!$this->isNewRelicEnabled()) {
35
            return;
36
        }
37
38
        return parent::write($record);
0 ignored issues
show
Bug introduced by
Are you sure the usage of parent::write($record) targeting Monolog\Handler\NewRelicHandler::write() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
39
    }
40
}
41