@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | public function __construct( |
18 | 18 | private readonly Tokenizer $tokenizer |
19 | - ) { |
|
19 | + ){ |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | public function __construct( |
24 | 24 | private readonly TokenizerConfig $config |
25 | - ) { |
|
25 | + ){ |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | $tokens = \token_get_all(\file_get_contents($filename)); |
64 | 64 | |
65 | 65 | $line = 0; |
66 | - foreach ($tokens as &$token) { |
|
67 | - if (isset($token[self::LINE])) { |
|
66 | + foreach ($tokens as &$token){ |
|
67 | + if (isset($token[self::LINE])){ |
|
68 | 68 | $line = $token[self::LINE]; |
69 | 69 | } |
70 | 70 | |
71 | - if (!\is_array($token)) { |
|
71 | + if (!\is_array($token)){ |
|
72 | 72 | $token = [$token, $token, $line]; |
73 | 73 | } |
74 | 74 | |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | { |
87 | 87 | $finder = new Finder(); |
88 | 88 | |
89 | - if (empty($directories)) { |
|
89 | + if (empty($directories)){ |
|
90 | 90 | $directories = $this->config->getDirectories(); |
91 | 91 | } |
92 | 92 | |
93 | - if (empty($exclude)) { |
|
93 | + if (empty($exclude)){ |
|
94 | 94 | $exclude = $this->config->getExcludes(); |
95 | 95 | } |
96 | 96 |
@@ -63,12 +63,15 @@ discard block |
||
63 | 63 | $tokens = \token_get_all(\file_get_contents($filename)); |
64 | 64 | |
65 | 65 | $line = 0; |
66 | - foreach ($tokens as &$token) { |
|
67 | - if (isset($token[self::LINE])) { |
|
66 | + foreach ($tokens as &$token) |
|
67 | + { |
|
68 | + if (isset($token[self::LINE])) |
|
69 | + { |
|
68 | 70 | $line = $token[self::LINE]; |
69 | 71 | } |
70 | 72 | |
71 | - if (!\is_array($token)) { |
|
73 | + if (!\is_array($token)) |
|
74 | + { |
|
72 | 75 | $token = [$token, $token, $line]; |
73 | 76 | } |
74 | 77 | |
@@ -86,11 +89,13 @@ discard block |
||
86 | 89 | { |
87 | 90 | $finder = new Finder(); |
88 | 91 | |
89 | - if (empty($directories)) { |
|
92 | + if (empty($directories)) |
|
93 | + { |
|
90 | 94 | $directories = $this->config->getDirectories(); |
91 | 95 | } |
92 | 96 | |
93 | - if (empty($exclude)) { |
|
97 | + if (empty($exclude)) |
|
98 | + { |
|
94 | 99 | $exclude = $this->config->getExcludes(); |
95 | 100 | } |
96 | 101 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | private readonly string $level, |
13 | 13 | private readonly string $message, |
14 | 14 | private readonly array $context = [] |
15 | - ) { |
|
15 | + ){ |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function getTime(): \DateTimeInterface |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | { |
15 | 15 | public function __construct( |
16 | 16 | private readonly ListenerRegistryInterface $listenedRegistry |
17 | - ) { |
|
17 | + ){ |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function getLogger(string $channel): LoggerInterface |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | $e = new LogEvent( |
28 | 28 | new \DateTime(), |
29 | 29 | $channel, |
30 | - (string) $level, |
|
30 | + (string)$level, |
|
31 | 31 | $message, |
32 | 32 | $context |
33 | 33 | ); |
34 | 34 | |
35 | - foreach ($this->listenedRegistry->getListeners() as $listener) { |
|
35 | + foreach ($this->listenedRegistry->getListeners() as $listener){ |
|
36 | 36 | \call_user_func($listener, $e); |
37 | 37 | } |
38 | 38 | } |
@@ -32,7 +32,8 @@ |
||
32 | 32 | $context |
33 | 33 | ); |
34 | 34 | |
35 | - foreach ($this->listenedRegistry->getListeners() as $listener) { |
|
35 | + foreach ($this->listenedRegistry->getListeners() as $listener) |
|
36 | + { |
|
36 | 37 | \call_user_func($listener, $e); |
37 | 38 | } |
38 | 39 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function getDefaultStorage(): string |
33 | 33 | { |
34 | - if (!\is_string($this->config['default'])) { |
|
34 | + if (!\is_string($this->config['default'])){ |
|
35 | 35 | throw new InvalidArgumentException('Default cache storage config value must be a string'); |
36 | 36 | } |
37 | 37 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | public function getStorageConfig(string $name): array |
42 | 42 | { |
43 | - if (!isset($this->config['storages'][$name])) { |
|
43 | + if (!isset($this->config['storages'][$name])){ |
|
44 | 44 | throw new InvalidArgumentException( |
45 | 45 | \sprintf('Config for storage `%s` is not defined.', $name) |
46 | 46 | ); |
@@ -48,19 +48,19 @@ discard block |
||
48 | 48 | |
49 | 49 | $config = $this->config['storages'][$name]; |
50 | 50 | |
51 | - if (!isset($config['type'])) { |
|
51 | + if (!isset($config['type'])){ |
|
52 | 52 | throw new InvalidArgumentException( |
53 | 53 | \sprintf('Storage type for `%s` is not defined.', $name) |
54 | 54 | ); |
55 | 55 | } |
56 | 56 | |
57 | - if (!\is_string($config['type'])) { |
|
57 | + if (!\is_string($config['type'])){ |
|
58 | 58 | throw new InvalidArgumentException( |
59 | 59 | \sprintf('Storage type value for `%s` must be a string', $name) |
60 | 60 | ); |
61 | 61 | } |
62 | 62 | |
63 | - if (isset($this->config['typeAliases'][$config['type']])) { |
|
63 | + if (isset($this->config['typeAliases'][$config['type']])){ |
|
64 | 64 | $config['type'] = $this->config['typeAliases'][$config['type']]; |
65 | 65 | } |
66 | 66 |
@@ -31,7 +31,8 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function getDefaultStorage(): string |
33 | 33 | { |
34 | - if (!\is_string($this->config['default'])) { |
|
34 | + if (!\is_string($this->config['default'])) |
|
35 | + { |
|
35 | 36 | throw new InvalidArgumentException('Default cache storage config value must be a string'); |
36 | 37 | } |
37 | 38 | |
@@ -40,7 +41,8 @@ discard block |
||
40 | 41 | |
41 | 42 | public function getStorageConfig(string $name): array |
42 | 43 | { |
43 | - if (!isset($this->config['storages'][$name])) { |
|
44 | + if (!isset($this->config['storages'][$name])) |
|
45 | + { |
|
44 | 46 | throw new InvalidArgumentException( |
45 | 47 | \sprintf('Config for storage `%s` is not defined.', $name) |
46 | 48 | ); |
@@ -48,19 +50,22 @@ discard block |
||
48 | 50 | |
49 | 51 | $config = $this->config['storages'][$name]; |
50 | 52 | |
51 | - if (!isset($config['type'])) { |
|
53 | + if (!isset($config['type'])) |
|
54 | + { |
|
52 | 55 | throw new InvalidArgumentException( |
53 | 56 | \sprintf('Storage type for `%s` is not defined.', $name) |
54 | 57 | ); |
55 | 58 | } |
56 | 59 | |
57 | - if (!\is_string($config['type'])) { |
|
60 | + if (!\is_string($config['type'])) |
|
61 | + { |
|
58 | 62 | throw new InvalidArgumentException( |
59 | 63 | \sprintf('Storage type value for `%s` must be a string', $name) |
60 | 64 | ); |
61 | 65 | } |
62 | 66 | |
63 | - if (isset($this->config['typeAliases'][$config['type']])) { |
|
67 | + if (isset($this->config['typeAliases'][$config['type']])) |
|
68 | + { |
|
64 | 69 | $config['type'] = $this->config['typeAliases'][$config['type']]; |
65 | 70 | } |
66 | 71 |
@@ -9,6 +9,6 @@ |
||
9 | 9 | public function __construct( |
10 | 10 | public readonly string $key, |
11 | 11 | public readonly mixed $value, |
12 | - ) { |
|
12 | + ){ |
|
13 | 13 | } |
14 | 14 | } |
@@ -8,6 +8,6 @@ |
||
8 | 8 | { |
9 | 9 | public function __construct( |
10 | 10 | public readonly string $key, |
11 | - ) { |
|
11 | + ){ |
|
12 | 12 | } |
13 | 13 | } |
@@ -9,6 +9,6 @@ |
||
9 | 9 | public function __construct( |
10 | 10 | public readonly string $key, |
11 | 11 | public readonly mixed $value |
12 | - ) { |
|
12 | + ){ |
|
13 | 13 | } |
14 | 14 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | return new \DateTimeImmutable(); |
22 | 22 | } |
23 | 23 | |
24 | - private function ttlToTimestamp(null|int|\DateInterval|\DateTimeInterface $ttl = null): int |
|
24 | + private function ttlToTimestamp(null | int | \DateInterval | \DateTimeInterface $ttl = null): int |
|
25 | 25 | { |
26 | 26 | return match (true) { |
27 | 27 | $ttl instanceof \DateInterval => $this->now()->add($ttl)->getTimestamp(), |