@@ -71,9 +71,9 @@ |
||
| 71 | 71 | $this->session = $session; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * {@inheritdoc} |
|
| 76 | - */ |
|
| 74 | + /** |
|
| 75 | + * {@inheritdoc} |
|
| 76 | + */ |
|
| 77 | 77 | public function set(string $key, float $value, int $ttl): bool |
| 78 | 78 | { |
| 79 | 79 | $this->session->set($key, [ |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * @class SessionStorage |
| 55 | 55 | * @package Platine\Framework\Http\RateLimit\Storage |
| 56 | 56 | */ |
| 57 | -class SessionStorage implements RateLimitStorageInterface |
|
| 58 | -{ |
|
| 57 | +class SessionStorage implements RateLimitStorageInterface { |
|
| 59 | 58 | /** |
| 60 | 59 | * The session instance |
| 61 | 60 | * @var Session |
@@ -66,8 +65,7 @@ discard block |
||
| 66 | 65 | * Create new instance |
| 67 | 66 | * @param Session $session |
| 68 | 67 | */ |
| 69 | - public function __construct(Session $session) |
|
| 70 | - { |
|
| 68 | + public function __construct(Session $session) { |
|
| 71 | 69 | $this->session = $session; |
| 72 | 70 | } |
| 73 | 71 | |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * @class InMemoryStorage |
| 54 | 54 | * @package Platine\Framework\Http\RateLimit\Storage |
| 55 | 55 | */ |
| 56 | -class InMemoryStorage implements RateLimitStorageInterface |
|
| 57 | -{ |
|
| 56 | +class InMemoryStorage implements RateLimitStorageInterface { |
|
| 58 | 57 | /** |
| 59 | 58 | * The data store |
| 60 | 59 | * @var array<string, mixed> |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | class ApcuStorage implements RateLimitStorageInterface |
| 58 | 58 | { |
| 59 | - /** |
|
| 59 | + /** |
|
| 60 | 60 | * Create new instance |
| 61 | 61 | */ |
| 62 | 62 | public function __construct() |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - /** |
|
| 71 | - * {@inheritdoc} |
|
| 72 | - */ |
|
| 70 | + /** |
|
| 71 | + * {@inheritdoc} |
|
| 72 | + */ |
|
| 73 | 73 | public function set(string $key, float $value, int $ttl): bool |
| 74 | 74 | { |
| 75 | 75 | return apcu_store($key, $value, $ttl); |
@@ -54,13 +54,11 @@ |
||
| 54 | 54 | * @class ApcuStorage |
| 55 | 55 | * @package Platine\Framework\Http\RateLimit\Storage |
| 56 | 56 | */ |
| 57 | -class ApcuStorage implements RateLimitStorageInterface |
|
| 58 | -{ |
|
| 57 | +class ApcuStorage implements RateLimitStorageInterface { |
|
| 59 | 58 | /** |
| 60 | 59 | * Create new instance |
| 61 | 60 | */ |
| 62 | - public function __construct() |
|
| 63 | - { |
|
| 61 | + public function __construct() { |
|
| 64 | 62 | if ((!extension_loaded('apcu')) || !((bool) ini_get('apc.enabled'))) { |
| 65 | 63 | throw new RuntimeException('The rate limit storage for APCu driver is not available.' |
| 66 | 64 | . ' Check if APCu extension is loaded and enabled.'); |
@@ -37,8 +37,7 @@ |
||
| 37 | 37 | * @class HttpTooManyRequestsException |
| 38 | 38 | * @package Platine\Framework\Http\Exception |
| 39 | 39 | */ |
| 40 | -class HttpTooManyRequestsException extends HttpSpecialException |
|
| 41 | -{ |
|
| 40 | +class HttpTooManyRequestsException extends HttpSpecialException { |
|
| 42 | 41 | /** |
| 43 | 42 | * |
| 44 | 43 | * @var int |
@@ -175,7 +175,7 @@ |
||
| 175 | 175 | return null; |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - if($type === 'string' && $value !== null){ |
|
| 178 | + if ($type === 'string' && $value !== null) { |
|
| 179 | 179 | $value = trim($value); |
| 180 | 180 | } |
| 181 | 181 | |
@@ -59,14 +59,12 @@ discard block |
||
| 59 | 59 | * @package Platine\Framework\Form\Param |
| 60 | 60 | * @template TEntity as Entity |
| 61 | 61 | */ |
| 62 | -class BaseParam implements JsonSerializable |
|
| 63 | -{ |
|
| 62 | +class BaseParam implements JsonSerializable { |
|
| 64 | 63 | /** |
| 65 | 64 | * Create new instance |
| 66 | 65 | * @param array<string, mixed> $data |
| 67 | 66 | */ |
| 68 | - public function __construct(array $data = []) |
|
| 69 | - { |
|
| 67 | + public function __construct(array $data = []) { |
|
| 70 | 68 | // Load default values |
| 71 | 69 | $this->loadDefaultValues(); |
| 72 | 70 | |
@@ -126,8 +124,7 @@ discard block |
||
| 126 | 124 | * Convert parameter to JSON array |
| 127 | 125 | * @return array<string, mixed> |
| 128 | 126 | */ |
| 129 | - public function jsonSerialize() |
|
| 130 | - { |
|
| 127 | + public function jsonSerialize() { |
|
| 131 | 128 | return $this->data(); |
| 132 | 129 | } |
| 133 | 130 | |
@@ -136,8 +133,7 @@ discard block |
||
| 136 | 133 | * @param string $name |
| 137 | 134 | * @return mixed|null |
| 138 | 135 | */ |
| 139 | - public function __get($name) |
|
| 140 | - { |
|
| 136 | + public function __get($name) { |
|
| 141 | 137 | if (property_exists($this, $name)) { |
| 142 | 138 | return $this->{$name}; |
| 143 | 139 | } |
@@ -157,8 +153,7 @@ discard block |
||
| 157 | 153 | * @param mixed $value |
| 158 | 154 | * @return mixed |
| 159 | 155 | */ |
| 160 | - protected function getPropertyValue(string $attribute, $value) |
|
| 161 | - { |
|
| 156 | + protected function getPropertyValue(string $attribute, $value) { |
|
| 162 | 157 | $types = $this->getPropertyTypes(); |
| 163 | 158 | $property = $types[$attribute] ?? null; |
| 164 | 159 | if ($property === null) { |
@@ -175,7 +170,7 @@ discard block |
||
| 175 | 170 | return null; |
| 176 | 171 | } |
| 177 | 172 | |
| 178 | - if($type === 'string' && $value !== null){ |
|
| 173 | + if($type === 'string' && $value !== null) { |
|
| 179 | 174 | $value = trim($value); |
| 180 | 175 | } |
| 181 | 176 | |