1 | <?php |
||
8 | class User extends ActiveRecordModelExtender |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * @var string $tableName name of the database table. |
||
13 | */ |
||
14 | protected $tableName = "ramverk1_users"; |
||
15 | |||
16 | /** |
||
17 | * Columns in the table. |
||
18 | * |
||
19 | * @var integer $id primary key auto incremented. |
||
20 | */ |
||
21 | public $id; |
||
22 | public $name; |
||
23 | public $email; |
||
24 | public $pass; |
||
25 | public $authority = "user"; |
||
26 | public $question; |
||
27 | |||
28 | |||
29 | 7 | public function setupUser($user) |
|
48 | |||
49 | /** |
||
50 | * Returns post with markdown and gravatar |
||
51 | * @param string $sql |
||
52 | * @param array $param |
||
|
|||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | 3 | public function getAllUsers($sql = null, $params = null) |
|
67 | |||
68 | /** |
||
69 | * return question/answer, three attributes are set, comments connected to them is an array. |
||
70 | * |
||
71 | * @return object |
||
72 | */ |
||
73 | 4 | public function getUser($name) |
|
79 | |||
80 | |||
81 | /** |
||
82 | * Check if user exists |
||
83 | * |
||
84 | * @param string $name |
||
85 | * |
||
86 | * @return boolean true if user exists in database else false |
||
87 | */ |
||
88 | 1 | public function userExists($name) |
|
93 | /** |
||
94 | * Returns gravatar link |
||
95 | * |
||
96 | * @param string $email |
||
97 | * |
||
98 | * @return string as gravatar link |
||
99 | */ |
||
100 | 1 | public function setGravatar() |
|
104 | |||
105 | /** |
||
106 | * Returns gravatar link |
||
107 | * |
||
108 | * @param string $name |
||
109 | * |
||
110 | * @return string as gravatar link |
||
111 | */ |
||
112 | 10 | public function getGravatar($name) |
|
117 | |||
118 | /** |
||
119 | * Set the pass. |
||
120 | * |
||
121 | * @param string $pass the pass to use. |
||
122 | * |
||
123 | * @return void |
||
124 | */ |
||
125 | 4 | public function setPassword($pass) |
|
129 | |||
130 | /** |
||
131 | * Verify the name and the pass, if successful the object contains |
||
132 | * all details from the database row. |
||
133 | * |
||
134 | * @param string $name name to check. |
||
135 | * @param string $pass the pass to use. |
||
136 | * |
||
137 | * @return boolean true if name and pass matches, else false. |
||
138 | */ |
||
139 | 3 | public function verifyPassword($name, $pass) |
|
144 | |||
145 | /** |
||
146 | * Verify the name and the anaswer, if successful the object contains |
||
147 | * all details from the database row. |
||
148 | * |
||
149 | * @param string $name name to check. |
||
150 | * @param string $answer the answer. |
||
151 | * |
||
152 | * @return boolean true if name and pass matches, else false. |
||
153 | */ |
||
154 | 1 | public function verifyQuestion($name, $answer) |
|
159 | |||
160 | |||
161 | /** |
||
162 | * Check if a post belongs to user |
||
163 | * |
||
164 | * |
||
165 | * @return boolean |
||
166 | */ |
||
167 | 1 | public function controlAuthority($loggedUser, $name) |
|
176 | } |
||
177 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.