To call it as an object:
class PasswordHash {
public function generate_bcrypt($user_password) {
return password_hash($user_password, PASSWORD_DEFAULT);
}
}
$password = 'password';
$passwordhash = new PasswordHash();
echo $passwordhash->generate_bcrypt($password);
To call it using the static method
class PasswordHash {
public static function generate_bcrypt($user_password) {
return password_hash($user_password, PASSWORD_DEFAULT);
}
}
$password = 'password';
echo PasswordHash::generate_bcrypt($password);
You'll need to adapt this to fit the separation of your class files, but you can get the general idea from the examples.