Passed
Push — multiproject/local-access ( 5353e5...767924 )
by Simon
03:31
created

CommunityUser::isIdentified()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
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\IIdentificationVerifier;
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
        return '[Community]';
37
    }
38
39
    public function setUsername($username)
40
    {
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getEmail()
47
    {
48
        global $cDataClearEmail;
49
50
        return $cDataClearEmail;
51
    }
52
53
    public function setEmail($email)
54
    {
55
    }
56
57
    public function getStatus()
58
    {
59
        return "Community";
60
    }
61
62
    public function getOnWikiName()
63
    {
64
        return "127.0.0.1";
65
    }
66
67
    public function setOnWikiName($onWikiName)
68
    {
69
    }
70
71
    public function getLastActive()
72
    {
73
        $now = new DateTime();
74
75
        return $now->format("Y-m-d H:i:s");
76
    }
77
78
    public function getForceLogout()
79
    {
80
        return true;
81
    }
82
83
    public function setForceLogout($forceLogout)
84
    {
85
    }
86
87
    /**
88
     * @param string $status
89
     */
90
    public function setStatus($status)
91
    {
92
    }
93
94
    public function getConfirmationDiff()
95
    {
96
        return null;
97
    }
98
99
    public function setConfirmationDiff($confirmationDiff)
100
    {
101
    }
102
103
104
    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

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