/**
* The options that we should connect to the database with.
*/
- private string $options;
+ private array $options;
/**
* The query we should use to retrieve the attributes for the user.
if (isset($config['options'])) {
$this->options = $config['options'];
+ } else {
+ $this->options = [];
}
}
* Check the password against a Drupal hash
*
*/
- private function check_password(string $password, string $hash): boolean {
+ private function check_password(string $password, string $hash): bool {
//
// The reason for running a separate process is so that the PHP global
* query the database with arbitrary queries that only require a user name.
*
*/
- private function query_db(string $queryname, string $query_params): array
+ private function query_db(string $queryname, array $query_params): array
{
$db = $this->connect();
* @param string $query_name Name of query in authsources
* @param array $extra_params Associative array of parameters to include in query
*/
- $donation_query = function (string $query_name, array $extra_params): array
- use (string $username) {
+ $donation_query = function (string $query_name, array $extra_params)
+ use ($username): array {
$parameters = ['username' => $username];
$old_membership_query = $donation_query;
- $compare_res = function (array $result, int $amount): void {
+ $compare_res = function (array $result, int $amount): bool {
foreach ($result[0] as $key => $value) {
if (intval($value) >= $amount) {
return true;
// the time window with a single donation. this approximates whether
// the person was, or would have been, a member during the configured
// time window.
- $nomination_process_analyze_history = function (array $selective_donations_history): boolean
- use (string $nomination_process_start_date, string $nomination_process_end_date) {
+ $nomination_process_analyze_history = function (array $selective_donations_history)
+ use ($nomination_process_start_date, $nomination_process_end_date): bool {
$eligible = false;
return false;
};
- $discussion_process_analyze_history = function (array $selective_donations_history): boolean
- use (string $discussion_process_start_date, string $discussion_process_end_date) {
+ $discussion_process_analyze_history = function (array $selective_donations_history)
+ use ($discussion_process_start_date, $discussion_process_end_date): bool {
$eligible = false;
$total = 0;
* @param string $password The password the user wrote.
* @return array Associative array with the users attributes.
*/
- protected function login(string $username, string $password): array
+ protected function login($username, $password)
{
//// keep this commented when it's not in use. it prints user passwords to the log file