src/Auth.php
private function getOpenPasswordResetRequests($userId) {
		try {
			$requests = $this->db->selectValue(
				'SELECT COUNT(*) FROM ' . $this->makeTableName('users_resets') . ' WHERE user = ? AND expires > ?',
				[
					$userId,
					\time()
				]
			);

			if (!empty($requests)) {
				return $requests;
			}
			else {
				return 0;
			}
		}
		catch (Error $e) {
			throw new DatabaseError($e->getMessage());
		}
	}
private function getOpenPasswordResetRequests($userId) {
		try {
			$requests = $this->db->selectValue(
				'SELECT COUNT(*) FROM ' . $this->makeTableName('users_resets') . ' WHERE user = ? AND expires > ?',
				[
					$userId,
					\time()
				]
			);

			if (!empty($requests)) {
				return $requests;
			}
			else {
				return 0;
			}
		}
		catch (Error $e) {
			throw new DatabaseError($e->getMessage());
		}
	}
private function getOpenPasswordResetRequests ( $ userId ) { try { $ requests = $ this -> db -> selectValue ( 'SELECT COUNT(*) FROM ' . $ this -> makeTableName ( 'users_resets' ) . ' WHERE user = ? AND expires > ?' , [ $ userId , \ time ( ) ] ) ; if ( ! empty ( $ requests ) ) { return $ requests ; } else { return 0 ; } } catch ( Error $ e ) { throw new DatabaseError ( $ e -> getMessage ( ) ) ; } }
Returns the number of open requests for a password reset by the specified user

@param int $userId the ID of the user to check the requests for
@return int the number of open requests for a password reset
@throws AuthError if an internal problem occurred (do *not* catch)
Returns the number of open requests for a password reset by the specified user