Test Failed
Push — main ( 7178bf...397c3b )
by Rafael
50:09
created

Auth   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 33
rs 10
c 1
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A login() 0 3 1
A logout() 0 3 1
A sendEmail() 0 2 1
A isLogged() 0 3 1
A changePassword() 0 4 1
1
<?php
2
3
namespace Alxarafe\Lib;
4
5
class Auth
6
{
7
    protected $auth;
8
9
    public function __construct(PHPAuth $auth)
10
    {
11
        $this->auth = $auth;
12
    }
13
14
    public function login($email, $password)
15
    {
16
        return $this->auth->login($email, $password);
17
    }
18
19
    public function isLogged()
20
    {
21
        return $this->auth->isLogged();
22
    }
23
24
    public function changePassword($currentPassword, $newPassword)
25
    {
26
        $uid = $this->auth->getCurrentUID();
27
        return $this->auth->changePassword($uid, $currentPassword, $newPassword);
28
    }
29
30
    public function sendEmail($email, $subject, $body)
31
    {
32
        // Implement email sending logic here, possibly using a separate email sending class or library
33
    }
34
35
    public function logout()
36
    {
37
        return $this->auth->logout();
38
    }
39
}
40