@@ -11,11 +11,11 @@ |
||
11 | 11 | |
12 | 12 | class Env |
13 | 13 | { |
14 | - public function __invoke($filePath ,$key, $default = null) |
|
14 | + public function __invoke($filePath, $key, $default = null) |
|
15 | 15 | { |
16 | 16 | |
17 | 17 | if (file_exists($filePath . '/.env')) { |
18 | - $_dotenv = new Dotenv($filePath ); |
|
18 | + $_dotenv = new Dotenv($filePath); |
|
19 | 19 | $_dotenv->load(); |
20 | 20 | unset($_dotenv); |
21 | 21 | }else { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $_dotenv = new Dotenv($filePath ); |
19 | 19 | $_dotenv->load(); |
20 | 20 | unset($_dotenv); |
21 | - }else { |
|
21 | + } else { |
|
22 | 22 | return ''; |
23 | 23 | } |
24 | 24 |
@@ -8,15 +8,15 @@ discard block |
||
8 | 8 | |
9 | 9 | namespace Core\Helpers; |
10 | 10 | |
11 | -class Hash{ |
|
11 | +class Hash { |
|
12 | 12 | /** |
13 | 13 | * Receives a string password and hashes it. |
14 | 14 | * |
15 | 15 | * @param string $password |
16 | 16 | * @return string $hash |
17 | 17 | */ |
18 | - public static function hash($password){ |
|
19 | - return (string)password_hash($password, PASSWORD_DEFAULT); |
|
18 | + public static function hash($password) { |
|
19 | + return (string) password_hash($password, PASSWORD_DEFAULT); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | * @param string $hash |
27 | 27 | * @return boolean If the hash was generated from the password |
28 | 28 | */ |
29 | - public static function checkHash($string, $hash){ |
|
30 | - if( password_verify( $string, $hash ) ){ |
|
29 | + public static function checkHash($string, $hash) { |
|
30 | + if (password_verify($string, $hash)) { |
|
31 | 31 | return true; |
32 | 32 | } |
33 | 33 | return false; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | abstract class _TranslateHandler |
15 | 15 | { |
16 | - protected $container ; |
|
16 | + protected $container; |
|
17 | 17 | protected $local; |
18 | 18 | |
19 | 19 | function __construct(ContainerInterface $container) |
@@ -39,5 +39,5 @@ discard block |
||
39 | 39 | return $this->container; |
40 | 40 | } |
41 | 41 | |
42 | - abstract public function trans(string $key , array $replace); |
|
42 | + abstract public function trans(string $key, array $replace); |
|
43 | 43 | } |
44 | 44 | \ No newline at end of file |
@@ -24,14 +24,14 @@ |
||
24 | 24 | return isset($_SESSION['user']); |
25 | 25 | } |
26 | 26 | |
27 | - public function attempt(string $username,string $password) |
|
27 | + public function attempt(string $username, string $password) |
|
28 | 28 | { |
29 | 29 | $user = UserDataAccess::getUserLoginField($username)->first(); |
30 | 30 | |
31 | 31 | if (!$user) { |
32 | 32 | return false; |
33 | 33 | } |
34 | - if (password_verify($password,'')) { |
|
34 | + if (password_verify($password, '')) { |
|
35 | 35 | $_SESSION['user'] = $user->id; |
36 | 36 | return true; |
37 | 37 | } |