@@ -79,7 +79,7 @@ |
||
| 79 | 79 | if (!extension_loaded('openssl')) { |
| 80 | 80 | throw new RuntimeException( |
| 81 | 81 | 'OpenSSL extension is not loaded or actived, ' |
| 82 | - . 'please check your PHP configuration' |
|
| 82 | + . 'please check your PHP configuration' |
|
| 83 | 83 | ); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * Class OpenSSL |
| 55 | 55 | * @package Platine\Security\Encryption |
| 56 | 56 | */ |
| 57 | -class OpenSSL implements AdapterInterface |
|
| 58 | -{ |
|
| 57 | +class OpenSSL implements AdapterInterface { |
|
| 59 | 58 | |
| 60 | 59 | /** |
| 61 | 60 | * OpenSSL cipher method constant |
@@ -74,8 +73,7 @@ discard block |
||
| 74 | 73 | * Create new instance |
| 75 | 74 | * @param array<string, mixed> $config |
| 76 | 75 | */ |
| 77 | - public function __construct(array $config = []) |
|
| 78 | - { |
|
| 76 | + public function __construct(array $config = []) { |
|
| 79 | 77 | if (!extension_loaded('openssl')) { |
| 80 | 78 | throw new RuntimeException( |
| 81 | 79 | 'OpenSSL extension is not loaded or actived, ' |
@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | * Class Cipher |
| 52 | 52 | * @package Platine\Security\Encryption |
| 53 | 53 | */ |
| 54 | -class Cipher |
|
| 55 | -{ |
|
| 54 | +class Cipher { |
|
| 56 | 55 | |
| 57 | 56 | /** |
| 58 | 57 | * The data to use for encryption/decryption |
@@ -77,8 +76,7 @@ discard block |
||
| 77 | 76 | * @param string $data |
| 78 | 77 | * @param string $key |
| 79 | 78 | */ |
| 80 | - public function __construct(string $data, string $key) |
|
| 81 | - { |
|
| 79 | + public function __construct(string $data, string $key) { |
|
| 82 | 80 | $this->data = $data; |
| 83 | 81 | $this->key = sha1($key); |
| 84 | 82 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * Class AdapterInterface |
| 52 | 52 | * @package Platine\Security\Encryption |
| 53 | 53 | */ |
| 54 | -interface AdapterInterface |
|
| 55 | -{ |
|
| 54 | +interface AdapterInterface { |
|
| 56 | 55 | |
| 57 | 56 | /** |
| 58 | 57 | * Create the initialization vector |
@@ -56,8 +56,7 @@ discard block |
||
| 56 | 56 | * Class Lang |
| 57 | 57 | * @package Platine\Security |
| 58 | 58 | */ |
| 59 | -class Encryption |
|
| 60 | -{ |
|
| 59 | +class Encryption { |
|
| 61 | 60 | |
| 62 | 61 | /** |
| 63 | 62 | * The adapter instance |
@@ -87,8 +86,7 @@ discard block |
||
| 87 | 86 | * Create new instance |
| 88 | 87 | * @param AdapterInterface|null $adapter |
| 89 | 88 | */ |
| 90 | - public function __construct(AdapterInterface $adapter = null) |
|
| 91 | - { |
|
| 89 | + public function __construct(AdapterInterface $adapter = null) { |
|
| 92 | 90 | $this->adapter = $adapter ? $adapter : new OpenSSL([]); |
| 93 | 91 | $this->initVectorSize = $this->adapter->getIVSize(); |
| 94 | 92 | $this->setSecret(''); |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * Class BcryptHash |
| 54 | 54 | * @package Platine\Security\Hash |
| 55 | 55 | */ |
| 56 | -class BcryptHash implements HashInterface |
|
| 57 | -{ |
|
| 56 | +class BcryptHash implements HashInterface { |
|
| 58 | 57 | |
| 59 | 58 | /** |
| 60 | 59 | * {@inhereitdoc} |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * Class HashInterface |
| 52 | 52 | * @package Platine\Security\Hash |
| 53 | 53 | */ |
| 54 | -interface HashInterface |
|
| 55 | -{ |
|
| 54 | +interface HashInterface { |
|
| 56 | 55 | /** |
| 57 | 56 | * Hash the given string |
| 58 | 57 | * @param string $plain |
@@ -39,6 +39,5 @@ |
||
| 39 | 39 | * Class HashException |
| 40 | 40 | * @package Platine\Security\Exception |
| 41 | 41 | */ |
| 42 | -class HashException extends Exception |
|
| 43 | -{ |
|
| 42 | +class HashException extends Exception { |
|
| 44 | 43 | } |
@@ -39,6 +39,5 @@ |
||
| 39 | 39 | * Class EncryptionException |
| 40 | 40 | * @package Platine\Security\Exception |
| 41 | 41 | */ |
| 42 | -class EncryptionException extends Exception |
|
| 43 | -{ |
|
| 42 | +class EncryptionException extends Exception { |
|
| 44 | 43 | } |