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

LoggerService::setAlert()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
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