Passed
Push — master ( 5573bb...437f03 )
by Sébastien
03:09
created

AccessLogger::__construct()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Infra\Log;
6
7
use Doctrine\ORM\EntityManager;
8
9
class AccessLogger
10
{
11
    public const TYPE_LOGIN_SUCCESS = 'log.success';
12
    public const TYPE_LOGIN_FAILURE = 'log.fail';
13
14
    public const SUPPORTED_TYPES = [
15
        self::TYPE_LOGIN_SUCCESS,
16
        self::TYPE_LOGIN_FAILURE
17
    ];
18
19
    /**
20
     * @var EntityManager
21
     */
22
    private $em;
23
24
    public function __construct(EntityManager $entityManager)
25
    {
26
        $this->em = $entityManager;
27
    }
28
29
    public function log(string $type, string $email, ?string $ip): void
0 ignored issues
show
Unused Code introduced by
The parameter $type is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
    public function log(/** @scrutinizer ignore-unused */ string $type, string $email, ?string $ip): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $email is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
    public function log(string $type, /** @scrutinizer ignore-unused */ string $email, ?string $ip): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $ip is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
    public function log(string $type, string $email, /** @scrutinizer ignore-unused */ ?string $ip): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
    {
31
    }
32
}
33