Passed
Push — master ( 0b75f0...6b8772 )
by Fernando
17:35
created

LoggerService   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 29.4%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 10
c 1
b 0
f 1
dl 0
loc 43
ccs 5
cts 17
cp 0.294
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setEmergency() 0 3 1
A __construct() 0 3 1
A setDebug() 0 3 1
A setInfo() 0 3 1
A setError() 0 3 1
A setCritical() 0 3 1
A setAlert() 0 3 1
A setWarning() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Service;
6
7
final class LoggerService
8
{
9
    /** @var \Monolog\Logger */
10
    private $logger;
11
12 56
    public function __construct(\Monolog\Logger $logger)
13
    {
14 56
        $this->logger = $logger;
15 56
    }
16
17
    public function setDebug(string $msg)
18
    {
19
        return $this->logger->debug($msg . ' (LEVEL-100)');
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->debug($msg . ' (LEVEL-100)') targeting Monolog\Logger::debug() 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...
20
    }
21
22 11
    public function setInfo(string $msg)
23
    {
24 11
        return $this->logger->info($msg . ' (LEVEL-200)');
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->info($msg . ' (LEVEL-200)') targeting Monolog\Logger::info() 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...
25
    }
26
27
    public function setWarning(string $msg)
28
    {
29
        return $this->logger->warning($msg . ' (LEVEL-300)');
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->warning($msg . ' (LEVEL-300)') targeting Monolog\Logger::warning() 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...
30
    }
31
32
    public function setError(string $msg)
33
    {
34
        return $this->logger->error($msg . ' (LEVEL-400)');
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->error($msg . ' (LEVEL-400)') targeting Monolog\Logger::error() 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...
35
    }
36
37
    public function setCritical(string $msg)
38
    {
39
        return $this->logger->critical($msg . ' (LEVEL-500)');
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->critical($msg . ' (LEVEL-500)') targeting Monolog\Logger::critical() 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...
40
    }
41
42
    public function setAlert(string $msg)
43
    {
44
        return $this->logger->alert($msg . ' (LEVEL-550)');
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->alert($msg . ' (LEVEL-550)') targeting Monolog\Logger::alert() 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...
45
    }
46
47
    public function setEmergency(string $msg)
48
    {
49
        return $this->logger->emergency($msg . ' (LEVEL-600)');
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->logger->emergency($msg . ' (LEVEL-600)') targeting Monolog\Logger::emergency() 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...
50
    }
51
}
52