@@ -54,8 +54,7 @@ |
||
| 54 | 54 | * @class RateLimit |
| 55 | 55 | * @package Platine\Framework\Http\RateLimit |
| 56 | 56 | */ |
| 57 | -class RateLimit |
|
| 58 | -{ |
|
| 57 | +class RateLimit { |
|
| 59 | 58 | /** |
| 60 | 59 | * Create new instance |
| 61 | 60 | * @param RateLimitStorageInterface $storage |
@@ -56,8 +56,7 @@ |
||
| 56 | 56 | * @package Platine\Framework\Http\Maintenance\Driver |
| 57 | 57 | * @template T |
| 58 | 58 | */ |
| 59 | -class FileMaintenanceDriver implements MaintenanceDriverInterface |
|
| 60 | -{ |
|
| 59 | +class FileMaintenanceDriver implements MaintenanceDriverInterface { |
|
| 61 | 60 | /** |
| 62 | 61 | * Create new instance |
| 63 | 62 | * @param Config<T> $config |
@@ -124,13 +124,13 @@ |
||
| 124 | 124 | ): array { |
| 125 | 125 | // @codeCoverageIgnoreStart |
| 126 | 126 | $query = $this->repository->filters($filters) |
| 127 | - ->query() |
|
| 128 | - ->where('module')->is($group) |
|
| 129 | - ->where('status')->is('Y') |
|
| 130 | - ->where(function (WhereStatement $where) use ($env) { |
|
| 127 | + ->query() |
|
| 128 | + ->where('module')->is($group) |
|
| 129 | + ->where('status')->is('Y') |
|
| 130 | + ->where(function (WhereStatement $where) use ($env) { |
|
| 131 | 131 | $where->where('env')->is($env) |
| 132 | 132 | ->orWhere('env')->isNull(); |
| 133 | - }); |
|
| 133 | + }); |
|
| 134 | 134 | // @codeCoverageIgnoreEnd |
| 135 | 135 | |
| 136 | 136 | /** @var Configuration[] $results */ |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | ->query() |
| 128 | 128 | ->where('module')->is($group) |
| 129 | 129 | ->where('status')->is('Y') |
| 130 | - ->where(function (WhereStatement $where) use ($env) { |
|
| 130 | + ->where(function(WhereStatement $where) use ($env) { |
|
| 131 | 131 | $where->where('env')->is($env) |
| 132 | 132 | ->orWhere('env')->isNull(); |
| 133 | 133 | }); |
@@ -56,14 +56,12 @@ |
||
| 56 | 56 | * @package Platine\Framework\Config |
| 57 | 57 | * @implements DatabaseConfigLoaderInterface<Configuration> |
| 58 | 58 | */ |
| 59 | -class DatabaseConfigLoader implements DatabaseConfigLoaderInterface |
|
| 60 | -{ |
|
| 59 | +class DatabaseConfigLoader implements DatabaseConfigLoaderInterface { |
|
| 61 | 60 | /** |
| 62 | 61 | * Create new instance |
| 63 | 62 | * @param ConfigurationRepositoryInterface<Configuration> $repository |
| 64 | 63 | */ |
| 65 | - public function __construct(protected ConfigurationRepositoryInterface $repository) |
|
| 66 | - { |
|
| 64 | + public function __construct(protected ConfigurationRepositoryInterface $repository) { |
|
| 67 | 65 | } |
| 68 | 66 | |
| 69 | 67 | /** |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class ConfigUtil |
| 52 | 52 | * @package Platine\Framework\Config |
| 53 | 53 | */ |
| 54 | -class ConfigUtil |
|
| 55 | -{ |
|
| 54 | +class ConfigUtil { |
|
| 56 | 55 | /** |
| 57 | 56 | * Convert the returned configuration to given type |
| 58 | 57 | * @param mixed $value |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | string $key, |
| 78 | 78 | mixed $default = null, |
| 79 | 79 | ?string $filter = null, |
| 80 | - int|array $options = 0 |
|
| 80 | + int | array $options = 0 |
|
| 81 | 81 | ): mixed { |
| 82 | 82 | return Env::get($key, $default, $filter, $options); |
| 83 | 83 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | { |
| 58 | 58 | /** |
| 59 | 59 | * Constants |
| 60 | - */ |
|
| 60 | + */ |
|
| 61 | 61 | public const ARROW = 1; |
| 62 | 62 | public const LINE = 2; |
| 63 | 63 | public const DOTTED = 3; |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * @class Link |
| 54 | 54 | * @package Platine\Framework\Helper\Mermaid\Graph |
| 55 | 55 | */ |
| 56 | -class Link implements Stringable |
|
| 57 | -{ |
|
| 56 | +class Link implements Stringable { |
|
| 58 | 57 | /** |
| 59 | 58 | * Constants |
| 60 | 59 | */ |
@@ -55,67 +55,67 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | class Graph implements Stringable |
| 57 | 57 | { |
| 58 | - /** |
|
| 59 | - * Constants |
|
| 60 | - */ |
|
| 58 | + /** |
|
| 59 | + * Constants |
|
| 60 | + */ |
|
| 61 | 61 | public const TOP_BOTTOM = 'TB'; |
| 62 | 62 | public const BOTTOM_TOP = 'BT'; |
| 63 | 63 | public const LEFT_RIGHT = 'LR'; |
| 64 | 64 | public const RIGHT_LEFT = 'RL'; |
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Space for each sub graph |
|
| 68 | - */ |
|
| 66 | + /** |
|
| 67 | + * Space for each sub graph |
|
| 68 | + */ |
|
| 69 | 69 | private const RENDER_SHIFT = 4; |
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * The list of sub graph |
|
| 73 | - * @var array<Graph> |
|
| 74 | - */ |
|
| 71 | + /** |
|
| 72 | + * The list of sub graph |
|
| 73 | + * @var array<Graph> |
|
| 74 | + */ |
|
| 75 | 75 | protected array $subGraphs = []; |
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * The list of nodes |
|
| 79 | - * @var array<string, Node> |
|
| 80 | - */ |
|
| 77 | + /** |
|
| 78 | + * The list of nodes |
|
| 79 | + * @var array<string, Node> |
|
| 80 | + */ |
|
| 81 | 81 | protected array $nodes = []; |
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * The list of links |
|
| 85 | - * @var array<Link> |
|
| 86 | - */ |
|
| 83 | + /** |
|
| 84 | + * The list of links |
|
| 85 | + * @var array<Link> |
|
| 86 | + */ |
|
| 87 | 87 | protected array $links = []; |
| 88 | 88 | |
| 89 | - /** |
|
| 90 | - * The graph parameter |
|
| 91 | - * @var array<string, mixed> |
|
| 92 | - */ |
|
| 89 | + /** |
|
| 90 | + * The graph parameter |
|
| 91 | + * @var array<string, mixed> |
|
| 92 | + */ |
|
| 93 | 93 | protected array $params = [ |
| 94 | - 'title' => 'Graph', |
|
| 95 | - 'direction' => self::LEFT_RIGHT, |
|
| 94 | + 'title' => 'Graph', |
|
| 95 | + 'direction' => self::LEFT_RIGHT, |
|
| 96 | 96 | ]; |
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * Style list |
|
| 100 | - * @var array<string> |
|
| 101 | - */ |
|
| 98 | + /** |
|
| 99 | + * Style list |
|
| 100 | + * @var array<string> |
|
| 101 | + */ |
|
| 102 | 102 | protected array $styles = []; |
| 103 | 103 | |
| 104 | - /** |
|
| 105 | - * Create new instance |
|
| 106 | - * @param array<string, mixed> $params |
|
| 107 | - */ |
|
| 104 | + /** |
|
| 105 | + * Create new instance |
|
| 106 | + * @param array<string, mixed> $params |
|
| 107 | + */ |
|
| 108 | 108 | public function __construct(array $params = []) |
| 109 | 109 | { |
| 110 | 110 | $this->setParams($params); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * Render the graph to string representation |
|
| 115 | - * @param bool $isMainGraph |
|
| 116 | - * @param int $shift |
|
| 117 | - * @return string |
|
| 118 | - */ |
|
| 113 | + /** |
|
| 114 | + * Render the graph to string representation |
|
| 115 | + * @param bool $isMainGraph |
|
| 116 | + * @param int $shift |
|
| 117 | + * @return string |
|
| 118 | + */ |
|
| 119 | 119 | public function render(bool $isMainGraph = true, int $shift = 0): string |
| 120 | 120 | { |
| 121 | 121 | $spaces = str_repeat(' ', $shift); |
@@ -171,11 +171,11 @@ discard block |
||
| 171 | 171 | return implode(PHP_EOL, $result); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - /** |
|
| 175 | - * Add new node |
|
| 176 | - * @param Node $node |
|
| 177 | - * @return $this |
|
| 178 | - */ |
|
| 174 | + /** |
|
| 175 | + * Add new node |
|
| 176 | + * @param Node $node |
|
| 177 | + * @return $this |
|
| 178 | + */ |
|
| 179 | 179 | public function addNode(Node $node): self |
| 180 | 180 | { |
| 181 | 181 | $this->nodes[$node->getId()] = $node; |
@@ -183,11 +183,11 @@ discard block |
||
| 183 | 183 | return $this; |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - /** |
|
| 187 | - * Add new link |
|
| 188 | - * @param Link $link |
|
| 189 | - * @return $this |
|
| 190 | - */ |
|
| 186 | + /** |
|
| 187 | + * Add new link |
|
| 188 | + * @param Link $link |
|
| 189 | + * @return $this |
|
| 190 | + */ |
|
| 191 | 191 | public function addLink(Link $link): self |
| 192 | 192 | { |
| 193 | 193 | $this->links[] = $link; |
@@ -195,11 +195,11 @@ discard block |
||
| 195 | 195 | return $this; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - /** |
|
| 199 | - * Add new style |
|
| 200 | - * @param string $style |
|
| 201 | - * @return $this |
|
| 202 | - */ |
|
| 198 | + /** |
|
| 199 | + * Add new style |
|
| 200 | + * @param string $style |
|
| 201 | + * @return $this |
|
| 202 | + */ |
|
| 203 | 203 | public function addStyle(string $style): self |
| 204 | 204 | { |
| 205 | 205 | $this->styles[] = $style; |
@@ -207,11 +207,11 @@ discard block |
||
| 207 | 207 | return $this; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - /** |
|
| 211 | - * Add new sub graph |
|
| 212 | - * @param Graph $subGraph |
|
| 213 | - * @return $this |
|
| 214 | - */ |
|
| 210 | + /** |
|
| 211 | + * Add new sub graph |
|
| 212 | + * @param Graph $subGraph |
|
| 213 | + * @return $this |
|
| 214 | + */ |
|
| 215 | 215 | public function addSubGraph(Graph $subGraph): self |
| 216 | 216 | { |
| 217 | 217 | $this->subGraphs[] = $subGraph; |
@@ -219,67 +219,67 @@ discard block |
||
| 219 | 219 | return $this; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - /** |
|
| 223 | - * Return the string representation |
|
| 224 | - * @return string |
|
| 225 | - */ |
|
| 222 | + /** |
|
| 223 | + * Return the string representation |
|
| 224 | + * @return string |
|
| 225 | + */ |
|
| 226 | 226 | public function __toString(): string |
| 227 | 227 | { |
| 228 | 228 | return $this->render(); |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| 232 | - /** |
|
| 233 | - * Return the parameters |
|
| 234 | - * @return array<string, mixed> |
|
| 235 | - */ |
|
| 232 | + /** |
|
| 233 | + * Return the parameters |
|
| 234 | + * @return array<string, mixed> |
|
| 235 | + */ |
|
| 236 | 236 | public function getParams(): array |
| 237 | 237 | { |
| 238 | 238 | return $this->params; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - /** |
|
| 242 | - * Set the parameters |
|
| 243 | - * @param array<string, mixed> $params |
|
| 244 | - * @return $this |
|
| 245 | - */ |
|
| 241 | + /** |
|
| 242 | + * Set the parameters |
|
| 243 | + * @param array<string, mixed> $params |
|
| 244 | + * @return $this |
|
| 245 | + */ |
|
| 246 | 246 | public function setParams(array $params) |
| 247 | 247 | { |
| 248 | 248 | $this->params = array_merge($this->params, $params); |
| 249 | 249 | return $this; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | - /** |
|
| 253 | - * Return the list of sub graph |
|
| 254 | - * @return array<Graph> |
|
| 255 | - */ |
|
| 252 | + /** |
|
| 253 | + * Return the list of sub graph |
|
| 254 | + * @return array<Graph> |
|
| 255 | + */ |
|
| 256 | 256 | public function getSubGraphs(): array |
| 257 | 257 | { |
| 258 | 258 | return $this->subGraphs; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - /** |
|
| 262 | - * Return the list of node |
|
| 263 | - * @return array<string, Node> |
|
| 264 | - */ |
|
| 261 | + /** |
|
| 262 | + * Return the list of node |
|
| 263 | + * @return array<string, Node> |
|
| 264 | + */ |
|
| 265 | 265 | public function getNodes(): array |
| 266 | 266 | { |
| 267 | 267 | return $this->nodes; |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - /** |
|
| 271 | - * Return the list of link |
|
| 272 | - * @return array<Link> |
|
| 273 | - */ |
|
| 270 | + /** |
|
| 271 | + * Return the list of link |
|
| 272 | + * @return array<Link> |
|
| 273 | + */ |
|
| 274 | 274 | public function getLinks(): array |
| 275 | 275 | { |
| 276 | 276 | return $this->links; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - /** |
|
| 280 | - * Return the list of style |
|
| 281 | - * @return array<string> |
|
| 282 | - */ |
|
| 279 | + /** |
|
| 280 | + * Return the list of style |
|
| 281 | + * @return array<string> |
|
| 282 | + */ |
|
| 283 | 283 | public function getStyles(): array |
| 284 | 284 | { |
| 285 | 285 | return $this->styles; |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * @class Graph |
| 54 | 54 | * @package Platine\Framework\Helper\Mermaid\Graph |
| 55 | 55 | */ |
| 56 | -class Graph implements Stringable |
|
| 57 | -{ |
|
| 56 | +class Graph implements Stringable { |
|
| 58 | 57 | /** |
| 59 | 58 | * Constants |
| 60 | 59 | */ |
@@ -105,8 +104,7 @@ discard block |
||
| 105 | 104 | * Create new instance |
| 106 | 105 | * @param array<string, mixed> $params |
| 107 | 106 | */ |
| 108 | - public function __construct(array $params = []) |
|
| 109 | - { |
|
| 107 | + public function __construct(array $params = []) { |
|
| 110 | 108 | $this->setParams($params); |
| 111 | 109 | } |
| 112 | 110 | |
@@ -243,8 +241,7 @@ discard block |
||
| 243 | 241 | * @param array<string, mixed> $params |
| 244 | 242 | * @return $this |
| 245 | 243 | */ |
| 246 | - public function setParams(array $params) |
|
| 247 | - { |
|
| 244 | + public function setParams(array $params) { |
|
| 248 | 245 | $this->params = array_merge($this->params, $params); |
| 249 | 246 | return $this; |
| 250 | 247 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class Helper |
| 52 | 52 | * @package Platine\Framework\Helper\Mermaid\Graph |
| 53 | 53 | */ |
| 54 | -class Helper |
|
| 55 | -{ |
|
| 54 | +class Helper { |
|
| 56 | 55 | /** |
| 57 | 56 | * Escape the given text |
| 58 | 57 | * @param string $text |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | { |
| 58 | 58 | /** |
| 59 | 59 | * Constants |
| 60 | - */ |
|
| 60 | + */ |
|
| 61 | 61 | public const SQUARE = '[%s]'; |
| 62 | 62 | public const ROUND = '(%s)'; |
| 63 | 63 | public const CIRCLE = '((%s))'; |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * @class Node |
| 54 | 54 | * @package Platine\Framework\Helper\Mermaid\Graph |
| 55 | 55 | */ |
| 56 | -class Node implements Stringable |
|
| 57 | -{ |
|
| 56 | +class Node implements Stringable { |
|
| 58 | 57 | /** |
| 59 | 58 | * Constants |
| 60 | 59 | */ |