Failed Conditions
Push — multiproject/prefs ( 965e5d )
by Simon
08:54
created

CommunityUser::setWelcomeSig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 0
c 0
b 0
f 0
dl 0
loc 2
ccs 0
cts 1
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
/******************************************************************************
3
 * Wikipedia Account Creation Assistance tool                                 *
4
 *                                                                            *
5
 * All code in this file is released into the public domain by the ACC        *
6
 * Development Team. Please see team.json for a list of contributors.         *
7
 ******************************************************************************/
8
9
namespace Waca\DataObjects;
10
11
use DateTime;
12
use Waca\IdentificationVerifier;
13
14
/**
15
 * User data object
16
 */
17
class CommunityUser extends User
18
{
19
    public function getId()
20
    {
21
        return -1;
22
    }
23
24
    public function save()
25
    {
26
        // Do nothing
27
    }
28
29
    #region properties
30
31
    /**
32
     * @return string
33
     */
34
    public function getUsername()
35
    {
36
        global $communityUsername;
37
38
        return $communityUsername;
39
    }
40
41
    public function setUsername($username)
42
    {
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getEmail()
49
    {
50
        global $cDataClearEmail;
51
52
        return $cDataClearEmail;
53
    }
54
55
    public function setEmail($email)
56
    {
57
    }
58
59
    public function getStatus()
60
    {
61
        return "Community";
62
    }
63
64
    public function getOnWikiName()
65
    {
66
        return "127.0.0.1";
67
    }
68
69
    public function setOnWikiName($onWikiName)
70
    {
71
    }
72
73
    public function getLastActive()
74
    {
75
        $now = new DateTime();
76
77
        return $now->format("Y-m-d H:i:s");
78
    }
79
80
    public function getForceLogout()
81
    {
82
        return true;
83
    }
84
85
    public function setForceLogout($forceLogout)
86
    {
87
    }
88
89
    /**
90
     * @param string $status
91
     */
92
    public function setStatus($status)
93
    {
94
    }
95
96
    public function getConfirmationDiff()
97
    {
98
        return null;
99
    }
100
101
    public function setConfirmationDiff($confirmationDiff)
102
    {
103
    }
104
105
106
    public function setUseAlternateSkin($useAlternate)
0 ignored issues
show
Unused Code introduced by
The parameter $useAlternate 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

106
    public function setUseAlternateSkin(/** @scrutinizer ignore-unused */ $useAlternate)

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...
107
    {
108
    }
109
110
    #endregion
111
112
    #region user access checks
113
114
    public function isIdentified(IdentificationVerifier $iv)
115
    {
116
        return false;
117
    }
118
119
    public function isSuspended()
120
    {
121
        return false;
122
    }
123
124
    public function isNewUser()
125
    {
126
        return false;
127
    }
128
129
    public function isDeclined()
130
    {
131
        return false;
132
    }
133
134
    public function isCommunityUser()
135
    {
136
        return true;
137
    }
138
139
    #endregion
140
141
    public function getApprovalDate()
142
    {
143
        $data = DateTime::createFromFormat("Y-m-d H:i:s", "1970-01-01 00:00:00");
144
145
        return $data;
146
    }
147
}
148