MailMotor   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 19
rs 10
c 2
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getListId() 0 3 2
A __construct() 0 3 1
1
<?php
2
3
namespace MailMotor\Bundle\MailMotorBundle;
4
5
/**
6
 * MailMotor
7
 *
8
 * @author Jeroen Desloovere <[email protected]>
9
 */
10
class MailMotor
11
{
12
    /** @var string|null - The default list id */
13
    protected $listId;
14
15
    public function __construct(?string $listId)
16
    {
17
        $this->listId = $listId;
18
    }
19
20
    /**
21
     * Get list id
22
     *
23
     * @param string|null $listId - If you want to use a custom list id
24
     * @return string|null
25
     */
26
    public function getListId(string $listId = null): ?string
27
    {
28
        return ($listId == null) ? $this->listId : $listId;
0 ignored issues
show
Bug introduced by
It seems like you are loosely comparing $listId of type null|string against null; this is ambiguous if the string can be empty. Consider using a strict comparison === instead.
Loading history...
29
    }
30
}
31