Issues (26)

src/Service/LoggerService.php (7 issues)

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