Passed
Pull Request — master (#1182)
by Aleksei
10:25
created
src/Tokenizer/src/Tokenizer.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,12 +63,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Logger/src/Event/LogEvent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Logger/src/LogFactory.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,8 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Cache/src/Config/CacheConfig.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Cache/src/Storage/InteractsWithTime.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
src/Cache/src/Storage/ArrayStorage.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
 
18 18
     public function __construct(
19 19
         private readonly int $ttl = 2_592_000
20
-    ) {
20
+    ){
21 21
     }
22 22
 
23 23
     public function get(string $key, mixed $default = null): mixed
24 24
     {
25
-        if (!isset($this->storage[$key])) {
25
+        if (!isset($this->storage[$key])){
26 26
             return $default;
27 27
         }
28 28
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
         $expiresAt = $item['timestamp'] ?? 0;
32 32
 
33
-        if ($expiresAt !== 0 && \time() >= $expiresAt) {
33
+        if ($expiresAt !== 0 && \time() >= $expiresAt){
34 34
             $this->delete($key);
35 35
 
36 36
             return $default;
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         return $item['value'];
40 40
     }
41 41
 
42
-    public function set(string $key, mixed $value, null|int|\DateInterval|\DateTimeInterface $ttl = null): bool
42
+    public function set(string $key, mixed $value, null | int | \DateInterval | \DateTimeInterface $ttl = null): bool
43 43
     {
44 44
         $this->storage[$key] = [
45 45
             'value' => $value,
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
     public function delete(string $key): bool
53 53
     {
54
-        if ($this->has($key)) {
54
+        if ($this->has($key)){
55 55
             unset($this->storage[$key]);
56 56
 
57 57
             return true;
@@ -71,16 +71,16 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $return = [];
73 73
 
74
-        foreach ($keys as $key) {
74
+        foreach ($keys as $key){
75 75
             $return[$key] = $this->get($key, $default);
76 76
         }
77 77
 
78 78
         return $return;
79 79
     }
80 80
 
81
-    public function setMultiple(iterable $values, null|int|\DateInterval|\DateTimeInterface $ttl = null): bool
81
+    public function setMultiple(iterable $values, null | int | \DateInterval | \DateTimeInterface $ttl = null): bool
82 82
     {
83
-        foreach ($values as $key => $value) {
83
+        foreach ($values as $key => $value){
84 84
             $this->set($key, $value, $ttl);
85 85
         }
86 86
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     {
92 92
         $state = null;
93 93
 
94
-        foreach ($keys as $key) {
94
+        foreach ($keys as $key){
95 95
             $result = $this->delete($key);
96 96
 
97 97
             $state = \is_null($state) ? $result : $result && $state;
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function get(string $key, mixed $default = null): mixed
24 24
     {
25
-        if (!isset($this->storage[$key])) {
25
+        if (!isset($this->storage[$key]))
26
+        {
26 27
             return $default;
27 28
         }
28 29
 
@@ -30,7 +31,8 @@  discard block
 block discarded – undo
30 31
 
31 32
         $expiresAt = $item['timestamp'] ?? 0;
32 33
 
33
-        if ($expiresAt !== 0 && \time() >= $expiresAt) {
34
+        if ($expiresAt !== 0 && \time() >= $expiresAt)
35
+        {
34 36
             $this->delete($key);
35 37
 
36 38
             return $default;
@@ -51,7 +53,8 @@  discard block
 block discarded – undo
51 53
 
52 54
     public function delete(string $key): bool
53 55
     {
54
-        if ($this->has($key)) {
56
+        if ($this->has($key))
57
+        {
55 58
             unset($this->storage[$key]);
56 59
 
57 60
             return true;
@@ -71,7 +74,8 @@  discard block
 block discarded – undo
71 74
     {
72 75
         $return = [];
73 76
 
74
-        foreach ($keys as $key) {
77
+        foreach ($keys as $key)
78
+        {
75 79
             $return[$key] = $this->get($key, $default);
76 80
         }
77 81
 
@@ -80,7 +84,8 @@  discard block
 block discarded – undo
80 84
 
81 85
     public function setMultiple(iterable $values, null|int|\DateInterval|\DateTimeInterface $ttl = null): bool
82 86
     {
83
-        foreach ($values as $key => $value) {
87
+        foreach ($values as $key => $value)
88
+        {
84 89
             $this->set($key, $value, $ttl);
85 90
         }
86 91
 
@@ -91,7 +96,8 @@  discard block
 block discarded – undo
91 96
     {
92 97
         $state = null;
93 98
 
94
-        foreach ($keys as $key) {
99
+        foreach ($keys as $key)
100
+        {
95 101
             $result = $this->delete($key);
96 102
 
97 103
             $state = \is_null($state) ? $result : $result && $state;
Please login to merge, or discard this patch.
src/Cache/src/Storage/FileStorage.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         private readonly FilesInterface $files,
17 17
         private readonly string $path,
18 18
         private readonly int $ttl = 2_592_000
19
-    ) {
19
+    ){
20 20
     }
21 21
 
22 22
     public function get(string $key, mixed $default = null): mixed
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
         return $this->getPayload($key)['value'] ?? $default;
25 25
     }
26 26
 
27
-    public function set(string $key, mixed $value, null|int|\DateInterval|\DateTimeInterface $ttl = null): bool
27
+    public function set(string $key, mixed $value, null | int | \DateInterval | \DateTimeInterface $ttl = null): bool
28 28
     {
29 29
         return $this->files->write(
30 30
             $this->makePath($key),
31
-            $this->ttlToTimestamp($ttl) . \serialize($value),
31
+            $this->ttlToTimestamp($ttl).\serialize($value),
32 32
             null,
33 33
             true
34 34
         );
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     public function delete(string $key): bool
38 38
     {
39
-        if ($this->has($key)) {
39
+        if ($this->has($key)){
40 40
             return $this->files->delete($this->makePath($key));
41 41
         }
42 42
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
     public function clear(): bool
47 47
     {
48
-        if (!$this->files->isDirectory($this->path)) {
48
+        if (!$this->files->isDirectory($this->path)){
49 49
             return false;
50 50
         }
51 51
 
@@ -58,18 +58,18 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $result = [];
60 60
 
61
-        foreach ($keys as $key) {
61
+        foreach ($keys as $key){
62 62
             $result[$key] = $this->get($key, $default);
63 63
         }
64 64
 
65 65
         return $result;
66 66
     }
67 67
 
68
-    public function setMultiple(iterable $values, null|int|\DateInterval|\DateTimeInterface $ttl = null): bool
68
+    public function setMultiple(iterable $values, null | int | \DateInterval | \DateTimeInterface $ttl = null): bool
69 69
     {
70 70
         $state = null;
71 71
 
72
-        foreach ($values as $key => $value) {
72
+        foreach ($values as $key => $value){
73 73
             $result = $this->set($key, $value, $ttl);
74 74
             $state = \is_null($state) ? $result : $result && $state;
75 75
         }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     public function deleteMultiple(iterable $keys): bool
81 81
     {
82 82
         $state = null;
83
-        foreach ($keys as $key) {
83
+        foreach ($keys as $key){
84 84
             $result = $this->delete($key);
85 85
             $state = \is_null($state) ? $result : $result && $state;
86 86
         }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     {
101 101
         $parts = \array_slice(\str_split($hash = \sha1($key), 2), 0, 2);
102 102
 
103
-        return $this->path . '/' . \implode('/', $parts) . '/' . $hash;
103
+        return $this->path.'/'.\implode('/', $parts).'/'.$hash;
104 104
     }
105 105
 
106 106
     /**
@@ -110,25 +110,25 @@  discard block
 block discarded – undo
110 110
     {
111 111
         $path = $this->makePath($key);
112 112
 
113
-        try {
114
-            $expire = (int) \substr(
113
+        try{
114
+            $expire = (int)\substr(
115 115
                 $contents = $this->files->read($path),
116 116
                 0,
117 117
                 10
118 118
             );
119
-        } catch (FileNotFoundException) {
119
+        }catch (FileNotFoundException){
120 120
             return $this->makeEmptyPayload();
121 121
         }
122 122
 
123
-        if (\time() >= $expire) {
123
+        if (\time() >= $expire){
124 124
             $this->delete($key);
125 125
 
126 126
             return $this->makeEmptyPayload();
127 127
         }
128 128
 
129
-        try {
129
+        try{
130 130
             $data = \unserialize(\substr($contents, 10));
131
-        } catch (\Exception) {
131
+        }catch (\Exception){
132 132
             $this->delete($key);
133 133
 
134 134
             return $this->makeEmptyPayload();
Please login to merge, or discard this patch.
Braces   +22 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@  discard block
 block discarded – undo
36 36
 
37 37
     public function delete(string $key): bool
38 38
     {
39
-        if ($this->has($key)) {
39
+        if ($this->has($key))
40
+        {
40 41
             return $this->files->delete($this->makePath($key));
41 42
         }
42 43
 
@@ -45,7 +46,8 @@  discard block
 block discarded – undo
45 46
 
46 47
     public function clear(): bool
47 48
     {
48
-        if (!$this->files->isDirectory($this->path)) {
49
+        if (!$this->files->isDirectory($this->path))
50
+        {
49 51
             return false;
50 52
         }
51 53
 
@@ -58,7 +60,8 @@  discard block
 block discarded – undo
58 60
     {
59 61
         $result = [];
60 62
 
61
-        foreach ($keys as $key) {
63
+        foreach ($keys as $key)
64
+        {
62 65
             $result[$key] = $this->get($key, $default);
63 66
         }
64 67
 
@@ -69,7 +72,8 @@  discard block
 block discarded – undo
69 72
     {
70 73
         $state = null;
71 74
 
72
-        foreach ($values as $key => $value) {
75
+        foreach ($values as $key => $value)
76
+        {
73 77
             $result = $this->set($key, $value, $ttl);
74 78
             $state = \is_null($state) ? $result : $result && $state;
75 79
         }
@@ -80,7 +84,8 @@  discard block
 block discarded – undo
80 84
     public function deleteMultiple(iterable $keys): bool
81 85
     {
82 86
         $state = null;
83
-        foreach ($keys as $key) {
87
+        foreach ($keys as $key)
88
+        {
84 89
             $result = $this->delete($key);
85 90
             $state = \is_null($state) ? $result : $result && $state;
86 91
         }
@@ -110,25 +115,32 @@  discard block
 block discarded – undo
110 115
     {
111 116
         $path = $this->makePath($key);
112 117
 
113
-        try {
118
+        try
119
+        {
114 120
             $expire = (int) \substr(
115 121
                 $contents = $this->files->read($path),
116 122
                 0,
117 123
                 10
118 124
             );
119
-        } catch (FileNotFoundException) {
125
+        }
126
+        catch (FileNotFoundException)
127
+        {
120 128
             return $this->makeEmptyPayload();
121 129
         }
122 130
 
123
-        if (\time() >= $expire) {
131
+        if (\time() >= $expire)
132
+        {
124 133
             $this->delete($key);
125 134
 
126 135
             return $this->makeEmptyPayload();
127 136
         }
128 137
 
129
-        try {
138
+        try
139
+        {
130 140
             $data = \unserialize(\substr($contents, 10));
131
-        } catch (\Exception) {
141
+        }
142
+        catch (\Exception)
143
+        {
132 144
             $this->delete($key);
133 145
 
134 146
             return $this->makeEmptyPayload();
Please login to merge, or discard this patch.
src/Stempler/tests/TraverserTest.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
         $doc = $this->parse('<a href="url"></a>');
33 33
 
34 34
         $t = new Traverser();
35
-        $t->addVisitor(new class() implements VisitorInterface {
35
+        $t->addVisitor(new class() implements VisitorInterface{
36 36
             public function enterNode(mixed $node, VisitorContext $ctx): mixed
37 37
             {
38
-                if ($node instanceof Tag && $node->name === 'a') {
38
+                if ($node instanceof Tag && $node->name === 'a'){
39 39
                     $node->name = 'b';
40 40
                 }
41 41
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $doc = $this->parse('<a href="url"></a>');
62 62
 
63 63
         $t = new Traverser();
64
-        $t->addVisitor(new class() implements VisitorInterface {
64
+        $t->addVisitor(new class() implements VisitorInterface{
65 65
             public function enterNode(mixed $node, VisitorContext $ctx): mixed
66 66
             {
67 67
                 return null;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
             public function leaveNode(mixed $node, VisitorContext $ctx): mixed
71 71
             {
72
-                if ($node instanceof Tag && $node->name === 'a') {
72
+                if ($node instanceof Tag && $node->name === 'a'){
73 73
                     $new = new Tag();
74 74
                     $new->name = 'link';
75 75
                     $new->void = true;
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $doc = $this->parse('<a href="url"><b></b>hello</a>');
95 95
 
96 96
         $t = new Traverser();
97
-        $t->addVisitor(new class() implements VisitorInterface {
97
+        $t->addVisitor(new class() implements VisitorInterface{
98 98
             public function enterNode(mixed $node, VisitorContext $ctx): mixed
99 99
             {
100 100
                 return null;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
             public function leaveNode(mixed $node, VisitorContext $ctx): mixed
104 104
             {
105
-                if ($node instanceof Tag && $node->name === 'b') {
105
+                if ($node instanceof Tag && $node->name === 'b'){
106 106
                     return VisitorInterface::REMOVE_NODE;
107 107
                 }
108 108
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
     public function enterNode(mixed $node, VisitorContext $ctx): mixed
132 132
     {
133
-        if ($ctx->getCurrentNode() instanceof Raw) {
133
+        if ($ctx->getCurrentNode() instanceof Raw){
134 134
             $this->assertInstanceOf(Tag::class, $ctx->getParentNode());
135 135
             $this->assertSame('b', $ctx->getParentNode()->name);
136 136
 
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,10 +32,12 @@  discard block
 block discarded – undo
32 32
         $doc = $this->parse('<a href="url"></a>');
33 33
 
34 34
         $t = new Traverser();
35
-        $t->addVisitor(new class() implements VisitorInterface {
35
+        $t->addVisitor(new class() implements VisitorInterface
36
+        {
36 37
             public function enterNode(mixed $node, VisitorContext $ctx): mixed
37 38
             {
38
-                if ($node instanceof Tag && $node->name === 'a') {
39
+                if ($node instanceof Tag && $node->name === 'a')
40
+                {
39 41
                     $node->name = 'b';
40 42
                 }
41 43
 
@@ -61,7 +63,8 @@  discard block
 block discarded – undo
61 63
         $doc = $this->parse('<a href="url"></a>');
62 64
 
63 65
         $t = new Traverser();
64
-        $t->addVisitor(new class() implements VisitorInterface {
66
+        $t->addVisitor(new class() implements VisitorInterface
67
+        {
65 68
             public function enterNode(mixed $node, VisitorContext $ctx): mixed
66 69
             {
67 70
                 return null;
@@ -69,7 +72,8 @@  discard block
 block discarded – undo
69 72
 
70 73
             public function leaveNode(mixed $node, VisitorContext $ctx): mixed
71 74
             {
72
-                if ($node instanceof Tag && $node->name === 'a') {
75
+                if ($node instanceof Tag && $node->name === 'a')
76
+                {
73 77
                     $new = new Tag();
74 78
                     $new->name = 'link';
75 79
                     $new->void = true;
@@ -94,7 +98,8 @@  discard block
 block discarded – undo
94 98
         $doc = $this->parse('<a href="url"><b></b>hello</a>');
95 99
 
96 100
         $t = new Traverser();
97
-        $t->addVisitor(new class() implements VisitorInterface {
101
+        $t->addVisitor(new class() implements VisitorInterface
102
+        {
98 103
             public function enterNode(mixed $node, VisitorContext $ctx): mixed
99 104
             {
100 105
                 return null;
@@ -102,7 +107,8 @@  discard block
 block discarded – undo
102 107
 
103 108
             public function leaveNode(mixed $node, VisitorContext $ctx): mixed
104 109
             {
105
-                if ($node instanceof Tag && $node->name === 'b') {
110
+                if ($node instanceof Tag && $node->name === 'b')
111
+                {
106 112
                     return VisitorInterface::REMOVE_NODE;
107 113
                 }
108 114
 
@@ -130,7 +136,8 @@  discard block
 block discarded – undo
130 136
 
131 137
     public function enterNode(mixed $node, VisitorContext $ctx): mixed
132 138
     {
133
-        if ($ctx->getCurrentNode() instanceof Raw) {
139
+        if ($ctx->getCurrentNode() instanceof Raw)
140
+        {
134 141
             $this->assertInstanceOf(Tag::class, $ctx->getParentNode());
135 142
             $this->assertSame('b', $ctx->getParentNode()->name);
136 143
 
Please login to merge, or discard this patch.
src/Stempler/src/Loader/DirectoryLoader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     public function __construct(
15 15
         private readonly string $directory,
16 16
         private readonly string $extension = '.dark.php'
17
-    ) {
17
+    ){
18 18
     }
19 19
 
20 20
     /**
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
             $this->extension
31 31
         );
32 32
 
33
-        if (!\file_exists($filename)) {
33
+        if (!\file_exists($filename)){
34 34
             throw new LoaderException(\sprintf('Unable to load `%s`, no such file', $path));
35 35
         }
36 36
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,8 @@
 block discarded – undo
30 30
             $this->extension
31 31
         );
32 32
 
33
-        if (!\file_exists($filename)) {
33
+        if (!\file_exists($filename))
34
+        {
34 35
             throw new LoaderException(\sprintf('Unable to load `%s`, no such file', $path));
35 36
         }
36 37
 
Please login to merge, or discard this patch.