| Total Complexity | 3 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class user_update { |
||
| 11 | public $__db; |
||
| 12 | |||
| 13 | public function __construct($conn){ |
||
| 15 | } |
||
| 16 | |||
| 17 | // fuck this, this can be compressed into 2 functions |
||
| 18 | |||
| 19 | function update_cooldown_time($username, $rowName) { |
||
|
|
|||
| 20 | $stmt = $this->__db->prepare("UPDATE users SET ".$rowName." = now() WHERE username = :username"); |
||
| 21 | $stmt->bindParam(":username", $username); |
||
| 22 | $stmt->execute(); |
||
| 23 | } |
||
| 24 | |||
| 25 | function update_row($username, $rowName, $new) { |
||
| 32 | } |
||
| 33 | } |
||
| 35 | ?> |
||
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.