Created
June 13, 2018 20:23
-
-
Save boscho87/e7bc2ccb12c4f4038b0a3d1c341f36fd to your computer and use it in GitHub Desktop.
Example of bad comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** example one (with to much comments) **/ | |
/** --- class code here ---- */ | |
/** | |
* if its not an admin user and the csrf token is okay and the | |
* current system is admin_system | |
**/ | |
public function chgUsrPwd(User $user, string $npwd) | |
{ | |
if($user->notAdmUsr() && $this->CsrfOk() && $this->currsys === 'admin_system'){ | |
//set the new password of the user | |
$user->setPwd($npwd); | |
return false; | |
} | |
return true; | |
} | |
?> | |
<?php | |
/** example two **/ | |
/** --- class code here ---- */ | |
public function changeUserPassword(User $user, string $newPassword) | |
{ | |
if($user->notAdminUser() && $this->CsrfIsValid() && $this->currentSystem === 'admin_system'){ | |
$user->setNewPassword($newPassword); | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment