FakeNewsletterSubscriber::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
class FakeNewsletterList
3
{
4
    public $kernel;
5
6
    function __construct()
7
    {
8
        $this->kernel = new Stub_Kernel();
9
    }
10
11
    function get($key)
12
    {
13
        switch ($key) {
14
            case 'reply_email':
15
                return '[email protected]';
16
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
17
            default:
18
                return 1;
19
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
20
        }
21
    }
22
23
    function getIntranet()
24
    {
25
        return new Stub_Intranet();
26
    }
27
}
28
29
class FakeNewsletterContact
30
{
31
    public $address;
32
33
    function __construct()
34
    {
35
        $this->address = new Stub_Address;
36
    }
37
38
    function get()
39
    {
40
        return 1;
41
    }
42
43
    function getLoginUrl()
44
    {
45
        return 'loginurl';
46
    }
47
}
48
49
class FakeNewsletterSubscriber
50
{
51
    function load()
52
    {
53
    }
54
55
    function get()
56
    {
57
        return 1;
58
    }
59
60
    function getContact()
61
    {
62
        return new FakeNewsletterContact;
63
    }
64
}
65