@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function generateKey(): string |
42 | 42 | { |
43 | - try { |
|
43 | + try{ |
|
44 | 44 | return Key::createNewRandomKey()->saveToAsciiSafeString(); |
45 | - } catch (CryptoException $e) { |
|
45 | + }catch (CryptoException $e){ |
|
46 | 46 | throw new EncrypterException($e->getMessage(), $e->getCode(), $e); |
47 | 47 | } |
48 | 48 | } |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function getKey(): string |
54 | 54 | { |
55 | - try { |
|
55 | + try{ |
|
56 | 56 | Key::loadFromAsciiSafeString($this->config->getKey()); |
57 | - } catch (CryptoException $e) { |
|
57 | + }catch (CryptoException $e){ |
|
58 | 58 | throw new EncrypterException($e->getMessage(), $e->getCode(), $e); |
59 | 59 | } |
60 | 60 |
@@ -40,9 +40,12 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function generateKey(): string |
42 | 42 | { |
43 | - try { |
|
43 | + try |
|
44 | + { |
|
44 | 45 | return Key::createNewRandomKey()->saveToAsciiSafeString(); |
45 | - } catch (CryptoException $e) { |
|
46 | + } |
|
47 | + catch (CryptoException $e) |
|
48 | + { |
|
46 | 49 | throw new EncrypterException($e->getMessage(), $e->getCode(), $e); |
47 | 50 | } |
48 | 51 | } |
@@ -52,9 +55,12 @@ discard block |
||
52 | 55 | */ |
53 | 56 | public function getKey(): string |
54 | 57 | { |
55 | - try { |
|
58 | + try |
|
59 | + { |
|
56 | 60 | Key::loadFromAsciiSafeString($this->config->getKey()); |
57 | - } catch (CryptoException $e) { |
|
61 | + } |
|
62 | + catch (CryptoException $e) |
|
63 | + { |
|
58 | 64 | throw new EncrypterException($e->getMessage(), $e->getCode(), $e); |
59 | 65 | } |
60 | 66 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function getSecured() |
94 | 94 | { |
95 | - if ($this->getProperty('secured', true) === '*') { |
|
95 | + if ($this->getProperty('secured', true) === '*'){ |
|
96 | 96 | return $this->getProperty('secured', true); |
97 | 97 | } |
98 | 98 | |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | public function declaredMethods(): array |
140 | 140 | { |
141 | 141 | $methods = []; |
142 | - foreach ($this->getMethods() as $method) { |
|
143 | - if ($method->getDeclaringClass()->getName() != $this->getName()) { |
|
142 | + foreach ($this->getMethods() as $method){ |
|
143 | + if ($method->getDeclaringClass()->getName() != $this->getName()){ |
|
144 | 144 | continue; |
145 | 145 | } |
146 | 146 | |
@@ -174,15 +174,15 @@ discard block |
||
174 | 174 | self::MUTATOR_ACCESSOR => [], |
175 | 175 | ]; |
176 | 176 | |
177 | - foreach ((array)$this->getProperty('getters', true) as $field => $filter) { |
|
177 | + foreach ((array)$this->getProperty('getters', true) as $field => $filter){ |
|
178 | 178 | $mutators[self::MUTATOR_GETTER][$field] = $filter; |
179 | 179 | } |
180 | 180 | |
181 | - foreach ((array)$this->getProperty('setters', true) as $field => $filter) { |
|
181 | + foreach ((array)$this->getProperty('setters', true) as $field => $filter){ |
|
182 | 182 | $mutators[self::MUTATOR_SETTER][$field] = $filter; |
183 | 183 | } |
184 | 184 | |
185 | - foreach ((array)$this->getProperty('accessors', true) as $field => $filter) { |
|
185 | + foreach ((array)$this->getProperty('accessors', true) as $field => $filter){ |
|
186 | 186 | $mutators[self::MUTATOR_ACCESSOR][$field] = $filter; |
187 | 187 | } |
188 | 188 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function getProperty(string $property, bool $merge = false) |
202 | 202 | { |
203 | - if (isset($this->propertyCache[$property])) { |
|
203 | + if (isset($this->propertyCache[$property])){ |
|
204 | 204 | //Property merging and trait events are pretty slow |
205 | 205 | return $this->propertyCache[$property]; |
206 | 206 | } |
@@ -208,27 +208,27 @@ discard block |
||
208 | 208 | $properties = $this->reflection->getDefaultProperties(); |
209 | 209 | $constants = $this->reflection->getConstants(); |
210 | 210 | |
211 | - if (isset($properties[$property])) { |
|
211 | + if (isset($properties[$property])){ |
|
212 | 212 | //Read from default value |
213 | 213 | $value = $properties[$property]; |
214 | - } elseif (isset($constants[strtoupper($property)])) { |
|
214 | + } elseif (isset($constants[strtoupper($property)])){ |
|
215 | 215 | //Read from a constant |
216 | 216 | $value = $constants[strtoupper($property)]; |
217 | - } else { |
|
217 | + }else{ |
|
218 | 218 | return null; |
219 | 219 | } |
220 | 220 | |
221 | 221 | //Merge with parent value requested |
222 | - if ($merge && is_array($value) && !empty($parent = $this->parentReflection())) { |
|
222 | + if ($merge && is_array($value) && !empty($parent = $this->parentReflection())){ |
|
223 | 223 | $parentValue = $parent->getProperty($property, $merge); |
224 | 224 | |
225 | - if (is_array($parentValue)) { |
|
225 | + if (is_array($parentValue)){ |
|
226 | 226 | //Class values prior to parent values |
227 | 227 | $value = array_merge($parentValue, $value); |
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
231 | - if (!$this->reflection->isSubclassOf(SchematicEntity::class)) { |
|
231 | + if (!$this->reflection->isSubclassOf(SchematicEntity::class)){ |
|
232 | 232 | return $value; |
233 | 233 | } |
234 | 234 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | { |
246 | 246 | $parentClass = $this->reflection->getParentClass(); |
247 | 247 | |
248 | - if (!empty($parentClass) && $parentClass->getName() != static::BASE_CLASS) { |
|
248 | + if (!empty($parentClass) && $parentClass->getName() != static::BASE_CLASS){ |
|
249 | 249 | $parent = clone $this; |
250 | 250 | $parent->reflection = $this->getParentClass(); |
251 | 251 |
@@ -92,7 +92,8 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function getSecured() |
94 | 94 | { |
95 | - if ($this->getProperty('secured', true) === '*') { |
|
95 | + if ($this->getProperty('secured', true) === '*') |
|
96 | + { |
|
96 | 97 | return $this->getProperty('secured', true); |
97 | 98 | } |
98 | 99 | |
@@ -139,8 +140,10 @@ discard block |
||
139 | 140 | public function declaredMethods(): array |
140 | 141 | { |
141 | 142 | $methods = []; |
142 | - foreach ($this->getMethods() as $method) { |
|
143 | - if ($method->getDeclaringClass()->getName() != $this->getName()) { |
|
143 | + foreach ($this->getMethods() as $method) |
|
144 | + { |
|
145 | + if ($method->getDeclaringClass()->getName() != $this->getName()) |
|
146 | + { |
|
144 | 147 | continue; |
145 | 148 | } |
146 | 149 | |
@@ -174,15 +177,18 @@ discard block |
||
174 | 177 | self::MUTATOR_ACCESSOR => [], |
175 | 178 | ]; |
176 | 179 | |
177 | - foreach ((array)$this->getProperty('getters', true) as $field => $filter) { |
|
180 | + foreach ((array)$this->getProperty('getters', true) as $field => $filter) |
|
181 | + { |
|
178 | 182 | $mutators[self::MUTATOR_GETTER][$field] = $filter; |
179 | 183 | } |
180 | 184 | |
181 | - foreach ((array)$this->getProperty('setters', true) as $field => $filter) { |
|
185 | + foreach ((array)$this->getProperty('setters', true) as $field => $filter) |
|
186 | + { |
|
182 | 187 | $mutators[self::MUTATOR_SETTER][$field] = $filter; |
183 | 188 | } |
184 | 189 | |
185 | - foreach ((array)$this->getProperty('accessors', true) as $field => $filter) { |
|
190 | + foreach ((array)$this->getProperty('accessors', true) as $field => $filter) |
|
191 | + { |
|
186 | 192 | $mutators[self::MUTATOR_ACCESSOR][$field] = $filter; |
187 | 193 | } |
188 | 194 | |
@@ -200,7 +206,8 @@ discard block |
||
200 | 206 | */ |
201 | 207 | public function getProperty(string $property, bool $merge = false) |
202 | 208 | { |
203 | - if (isset($this->propertyCache[$property])) { |
|
209 | + if (isset($this->propertyCache[$property])) |
|
210 | + { |
|
204 | 211 | //Property merging and trait events are pretty slow |
205 | 212 | return $this->propertyCache[$property]; |
206 | 213 | } |
@@ -208,27 +215,35 @@ discard block |
||
208 | 215 | $properties = $this->reflection->getDefaultProperties(); |
209 | 216 | $constants = $this->reflection->getConstants(); |
210 | 217 | |
211 | - if (isset($properties[$property])) { |
|
218 | + if (isset($properties[$property])) |
|
219 | + { |
|
212 | 220 | //Read from default value |
213 | 221 | $value = $properties[$property]; |
214 | - } elseif (isset($constants[strtoupper($property)])) { |
|
222 | + } |
|
223 | + elseif (isset($constants[strtoupper($property)])) |
|
224 | + { |
|
215 | 225 | //Read from a constant |
216 | 226 | $value = $constants[strtoupper($property)]; |
217 | - } else { |
|
227 | + } |
|
228 | + else |
|
229 | + { |
|
218 | 230 | return null; |
219 | 231 | } |
220 | 232 | |
221 | 233 | //Merge with parent value requested |
222 | - if ($merge && is_array($value) && !empty($parent = $this->parentReflection())) { |
|
234 | + if ($merge && is_array($value) && !empty($parent = $this->parentReflection())) |
|
235 | + { |
|
223 | 236 | $parentValue = $parent->getProperty($property, $merge); |
224 | 237 | |
225 | - if (is_array($parentValue)) { |
|
238 | + if (is_array($parentValue)) |
|
239 | + { |
|
226 | 240 | //Class values prior to parent values |
227 | 241 | $value = array_merge($parentValue, $value); |
228 | 242 | } |
229 | 243 | } |
230 | 244 | |
231 | - if (!$this->reflection->isSubclassOf(SchematicEntity::class)) { |
|
245 | + if (!$this->reflection->isSubclassOf(SchematicEntity::class)) |
|
246 | + { |
|
232 | 247 | return $value; |
233 | 248 | } |
234 | 249 | |
@@ -245,7 +260,8 @@ discard block |
||
245 | 260 | { |
246 | 261 | $parentClass = $this->reflection->getParentClass(); |
247 | 262 | |
248 | - if (!empty($parentClass) && $parentClass->getName() != static::BASE_CLASS) { |
|
263 | + if (!empty($parentClass) && $parentClass->getName() != static::BASE_CLASS) |
|
264 | + { |
|
249 | 265 | $parent = clone $this; |
250 | 266 | $parent->reflection = $this->getParentClass(); |
251 | 267 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | protected static function filter($v) |
22 | 22 | { |
23 | - if (is_array($v)) { |
|
23 | + if (is_array($v)){ |
|
24 | 24 | throw new RuntimeException("can't be array"); |
25 | 25 | } |
26 | 26 |
@@ -20,7 +20,8 @@ |
||
20 | 20 | |
21 | 21 | protected static function filter($v) |
22 | 22 | { |
23 | - if (is_array($v)) { |
|
23 | + if (is_array($v)) |
|
24 | + { |
|
24 | 25 | throw new RuntimeException("can't be array"); |
25 | 26 | } |
26 | 27 |
@@ -75,7 +75,7 @@ |
||
75 | 75 | $this->assertEquals([], $entity->getValue()); |
76 | 76 | |
77 | 77 | $entity['a'] = 90; |
78 | - foreach ($entity as $key => $value) { |
|
78 | + foreach ($entity as $key => $value){ |
|
79 | 79 | $this->assertSame('a', $key); |
80 | 80 | $this->assertSame(90, $value); |
81 | 81 | } |
@@ -75,7 +75,8 @@ |
||
75 | 75 | $this->assertEquals([], $entity->getValue()); |
76 | 76 | |
77 | 77 | $entity['a'] = 90; |
78 | - foreach ($entity as $key => $value) { |
|
78 | + foreach ($entity as $key => $value) |
|
79 | + { |
|
79 | 80 | $this->assertSame('a', $key); |
80 | 81 | $this->assertSame(90, $value); |
81 | 82 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | protected function isNullable(string $field): bool |
22 | 22 | { |
23 | - if (parent::isNullable($field)) { |
|
23 | + if (parent::isNullable($field)){ |
|
24 | 24 | return true; |
25 | 25 | } |
26 | 26 |
@@ -20,7 +20,8 @@ |
||
20 | 20 | |
21 | 21 | protected function isNullable(string $field): bool |
22 | 22 | { |
23 | - if (parent::isNullable($field)) { |
|
23 | + if (parent::isNullable($field)) |
|
24 | + { |
|
24 | 25 | return true; |
25 | 26 | } |
26 | 27 |
@@ -68,11 +68,11 @@ |
||
68 | 68 | */ |
69 | 69 | public function getActor(): ?object |
70 | 70 | { |
71 | - if ($this->closed) { |
|
71 | + if ($this->closed){ |
|
72 | 72 | return null; |
73 | 73 | } |
74 | 74 | |
75 | - if ($this->actor === null && $this->token !== null) { |
|
75 | + if ($this->actor === null && $this->token !== null){ |
|
76 | 76 | $this->actor = $this->actorProvider->getActor($this->token); |
77 | 77 | } |
78 | 78 |
@@ -68,11 +68,13 @@ |
||
68 | 68 | */ |
69 | 69 | public function getActor(): ?object |
70 | 70 | { |
71 | - if ($this->closed) { |
|
71 | + if ($this->closed) |
|
72 | + { |
|
72 | 73 | return null; |
73 | 74 | } |
74 | 75 | |
75 | - if ($this->actor === null && $this->token !== null) { |
|
76 | + if ($this->actor === null && $this->token !== null) |
|
77 | + { |
|
76 | 78 | $this->actor = $this->actorProvider->getActor($this->token); |
77 | 79 | } |
78 | 80 |
@@ -89,7 +89,8 @@ discard block |
||
89 | 89 | { |
90 | 90 | $d = $this->makeDumper(); |
91 | 91 | |
92 | - $result = $d->dump(new class() { |
|
92 | + $result = $d->dump(new class() |
|
93 | + { |
|
93 | 94 | private $name = 'Test'; |
94 | 95 | }, Dumper::RETURN); |
95 | 96 | |
@@ -151,7 +152,8 @@ discard block |
||
151 | 152 | public function testDebugInfo(): void |
152 | 153 | { |
153 | 154 | $d = $this->makeDumper(); |
154 | - $result = $d->dump(new class() { |
|
155 | + $result = $d->dump(new class() |
|
156 | + { |
|
155 | 157 | protected $inner = '_kk_'; |
156 | 158 | |
157 | 159 | public function __debugInfo() |
@@ -171,7 +173,8 @@ discard block |
||
171 | 173 | public function testinternal(): void |
172 | 174 | { |
173 | 175 | $d = $this->makeDumper(); |
174 | - $result = $d->dump(new class() { |
|
176 | + $result = $d->dump(new class() |
|
177 | + { |
|
175 | 178 | protected $visible = '_kk_'; |
176 | 179 | |
177 | 180 | /** @internal */ |
@@ -198,7 +201,8 @@ discard block |
||
198 | 201 | $d = $this->makeDumper(); |
199 | 202 | $d->setRenderer(Dumper::RETURN, new HtmlRenderer()); |
200 | 203 | |
201 | - $result = $d->dump(new class() { |
|
204 | + $result = $d->dump(new class() |
|
205 | + { |
|
202 | 206 | protected static $static = 'yes'; |
203 | 207 | |
204 | 208 | private $value = 123; |
@@ -222,7 +226,8 @@ discard block |
||
222 | 226 | $d->setRenderer(Dumper::RETURN, new HtmlRenderer(HtmlRenderer::INVERTED)); |
223 | 227 | $d->setMaxLevel(5); |
224 | 228 | |
225 | - $result = $d->dump(new class() { |
|
229 | + $result = $d->dump(new class() |
|
230 | + { |
|
226 | 231 | private $value = 123; |
227 | 232 | |
228 | 233 | protected $visible = '_kk_'; |
@@ -246,7 +251,8 @@ discard block |
||
246 | 251 | $d->setRenderer(Dumper::RETURN, new ConsoleRenderer()); |
247 | 252 | $d->setMaxLevel(5); |
248 | 253 | |
249 | - $result = $d->dump(new class() { |
|
254 | + $result = $d->dump(new class() |
|
255 | + { |
|
250 | 256 | private $value = 123; |
251 | 257 | |
252 | 258 | protected $visible = '_kk_'; |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | $d->dump(1); |
30 | 30 | $result = ob_get_clean(); |
31 | 31 | |
32 | - $this->assertSame($d->dump(1, Dumper::RETURN), $result); |
|
32 | + $this->assertSame($d->dump(1, Dumper::return), $result); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | private function makeDumper(LoggerInterface $logger = null) |
36 | 36 | { |
37 | 37 | $d = new Dumper($logger); |
38 | 38 | $d->setRenderer(Dumper::OUTPUT, new PlainRenderer()); |
39 | - $d->setRenderer(Dumper::RETURN, new PlainRenderer()); |
|
39 | + $d->setRenderer(Dumper::return, new PlainRenderer()); |
|
40 | 40 | $d->setRenderer(Dumper::OUTPUT_CLI_COLORS, new PlainRenderer()); |
41 | 41 | |
42 | 42 | return $d; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function testScalar(): void |
46 | 46 | { |
47 | 47 | $d = $this->makeDumper(); |
48 | - $result = $d->dump(123, Dumper::RETURN); |
|
48 | + $result = $d->dump(123, Dumper::return); |
|
49 | 49 | |
50 | 50 | $this->assertStringContainsString('123', $result); |
51 | 51 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function testString(): void |
54 | 54 | { |
55 | 55 | $d = $this->makeDumper(); |
56 | - $result = $d->dump('hello world', Dumper::RETURN); |
|
56 | + $result = $d->dump('hello world', Dumper::return); |
|
57 | 57 | |
58 | 58 | $this->assertStringContainsString('hello world', $result); |
59 | 59 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function testResource(): void |
62 | 62 | { |
63 | 63 | $d = $this->makeDumper(); |
64 | - $result = $d->dump(STDOUT, Dumper::RETURN); |
|
64 | + $result = $d->dump(STDOUT, Dumper::return); |
|
65 | 65 | |
66 | 66 | $this->assertStringContainsString('resource', $result); |
67 | 67 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public function testHTML(): void |
70 | 70 | { |
71 | 71 | $d = $this->makeDumper(); |
72 | - $result = $d->dump('hello <br/>world', Dumper::RETURN); |
|
72 | + $result = $d->dump('hello <br/>world', Dumper::return); |
|
73 | 73 | |
74 | 74 | $this->assertStringContainsString('hello <br/>world', $result); |
75 | 75 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function testArray(): void |
78 | 78 | { |
79 | 79 | $d = $this->makeDumper(); |
80 | - $result = $d->dump(['G', 'B', 'N'], Dumper::RETURN); |
|
80 | + $result = $d->dump(['G', 'B', 'N'], Dumper::return); |
|
81 | 81 | |
82 | 82 | $this->assertStringContainsString('array', $result); |
83 | 83 | $this->assertStringContainsString('G', $result); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | $result = $d->dump(new class() { |
93 | 93 | private $name = 'Test'; |
94 | - }, Dumper::RETURN); |
|
94 | + }, Dumper::return); |
|
95 | 95 | |
96 | 96 | $this->assertStringContainsString('object', $result); |
97 | 97 | $this->assertStringContainsString('private', $result); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $result = $d->dump(static function (): void { |
108 | 108 | echo 'hello world'; |
109 | - }, Dumper::RETURN); |
|
109 | + }, Dumper::return); |
|
110 | 110 | |
111 | 111 | $this->assertStringContainsString('Closure', $result); |
112 | 112 | $this->assertStringContainsString('DumperTest.php', $result); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $mock = $this->createMock(LoggerInterface::class); |
118 | 118 | $d = $this->makeDumper($mock); |
119 | 119 | |
120 | - $mock->method('debug')->with($d->dump('abc', Dumper::RETURN)); |
|
120 | + $mock->method('debug')->with($d->dump('abc', Dumper::return)); |
|
121 | 121 | $this->assertNull($d->dump('abc', Dumper::LOGGER)); |
122 | 122 | } |
123 | 123 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | '_magic_' => '_value_', |
161 | 161 | ]; |
162 | 162 | } |
163 | - }, Dumper::RETURN); |
|
163 | + }, Dumper::return); |
|
164 | 164 | |
165 | 165 | $this->assertStringContainsString('_magic_', $result); |
166 | 166 | $this->assertStringContainsString('_value_', $result); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | |
177 | 177 | /** @internal */ |
178 | 178 | protected $internal = '_ok_'; |
179 | - }, Dumper::RETURN); |
|
179 | + }, Dumper::return); |
|
180 | 180 | |
181 | 181 | $this->assertStringContainsString('visible', $result); |
182 | 182 | $this->assertStringContainsString('_kk_', $result); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | public function testHtmlRenderer(): void |
197 | 197 | { |
198 | 198 | $d = $this->makeDumper(); |
199 | - $d->setRenderer(Dumper::RETURN, new HtmlRenderer()); |
|
199 | + $d->setRenderer(Dumper::return, new HtmlRenderer()); |
|
200 | 200 | |
201 | 201 | $result = $d->dump(new class() { |
202 | 202 | protected static $static = 'yes'; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | /** @internal */ |
209 | 209 | protected $internal = '_ok_'; |
210 | - }, Dumper::RETURN); |
|
210 | + }, Dumper::return); |
|
211 | 211 | |
212 | 212 | $this->assertStringContainsString('visible', $result); |
213 | 213 | $this->assertStringContainsString('_kk_', $result); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | public function testInvertedRenderer(): void |
220 | 220 | { |
221 | 221 | $d = $this->makeDumper(); |
222 | - $d->setRenderer(Dumper::RETURN, new HtmlRenderer(HtmlRenderer::INVERTED)); |
|
222 | + $d->setRenderer(Dumper::return, new HtmlRenderer(HtmlRenderer::INVERTED)); |
|
223 | 223 | $d->setMaxLevel(5); |
224 | 224 | |
225 | 225 | $result = $d->dump(new class() { |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | |
232 | 232 | /** @internal */ |
233 | 233 | protected $internal = '_ok_'; |
234 | - }, Dumper::RETURN); |
|
234 | + }, Dumper::return); |
|
235 | 235 | |
236 | 236 | $this->assertStringContainsString('visible', $result); |
237 | 237 | $this->assertStringContainsString('_kk_', $result); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | public function testConsoleRenderer(): void |
244 | 244 | { |
245 | 245 | $d = $this->makeDumper(); |
246 | - $d->setRenderer(Dumper::RETURN, new ConsoleRenderer()); |
|
246 | + $d->setRenderer(Dumper::return, new ConsoleRenderer()); |
|
247 | 247 | $d->setMaxLevel(5); |
248 | 248 | |
249 | 249 | $result = $d->dump(new class() { |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | /** @internal */ |
257 | 257 | protected $internal = '_ok_'; |
258 | - }, Dumper::RETURN); |
|
258 | + }, Dumper::return); |
|
259 | 259 | |
260 | 260 | $this->assertStringContainsString('visible', $result); |
261 | 261 | $this->assertStringContainsString('_kk_', $result); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @var string |
25 | 25 | */ |
26 | - protected $element = '%s%s' . Color::RESET; |
|
26 | + protected $element = '%s%s'.Color::RESET; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Set of styles associated with different dumping properties. |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function apply($element, string $type, string $context = ''): string |
64 | 64 | { |
65 | - if (!empty($style = $this->getStyle($type, $context))) { |
|
65 | + if (!empty($style = $this->getStyle($type, $context))){ |
|
66 | 66 | return sprintf($this->element, $style, $element); |
67 | 67 | } |
68 | 68 | |
@@ -87,15 +87,15 @@ discard block |
||
87 | 87 | */ |
88 | 88 | private function getStyle(string $type, string $context): string |
89 | 89 | { |
90 | - if (isset($this->styles[$type][$context])) { |
|
90 | + if (isset($this->styles[$type][$context])){ |
|
91 | 91 | return $this->styles[$type][$context]; |
92 | 92 | } |
93 | 93 | |
94 | - if (isset($this->styles[$type]['common'])) { |
|
94 | + if (isset($this->styles[$type]['common'])){ |
|
95 | 95 | return $this->styles[$type]['common']; |
96 | 96 | } |
97 | 97 | |
98 | - if (isset($this->styles[$type]) && is_string($this->styles[$type])) { |
|
98 | + if (isset($this->styles[$type]) && is_string($this->styles[$type])){ |
|
99 | 99 | return $this->styles[$type]; |
100 | 100 | } |
101 | 101 |
@@ -62,7 +62,8 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function apply($element, string $type, string $context = ''): string |
64 | 64 | { |
65 | - if (!empty($style = $this->getStyle($type, $context))) { |
|
65 | + if (!empty($style = $this->getStyle($type, $context))) |
|
66 | + { |
|
66 | 67 | return sprintf($this->element, $style, $element); |
67 | 68 | } |
68 | 69 | |
@@ -87,15 +88,18 @@ discard block |
||
87 | 88 | */ |
88 | 89 | private function getStyle(string $type, string $context): string |
89 | 90 | { |
90 | - if (isset($this->styles[$type][$context])) { |
|
91 | + if (isset($this->styles[$type][$context])) |
|
92 | + { |
|
91 | 93 | return $this->styles[$type][$context]; |
92 | 94 | } |
93 | 95 | |
94 | - if (isset($this->styles[$type]['common'])) { |
|
96 | + if (isset($this->styles[$type]['common'])) |
|
97 | + { |
|
95 | 98 | return $this->styles[$type]['common']; |
96 | 99 | } |
97 | 100 | |
98 | - if (isset($this->styles[$type]) && is_string($this->styles[$type])) { |
|
101 | + if (isset($this->styles[$type]) && is_string($this->styles[$type])) |
|
102 | + { |
|
99 | 103 | return $this->styles[$type]; |
100 | 104 | } |
101 | 105 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function indent(int $level): string |
44 | 44 | { |
45 | - if ($level == 0) { |
|
45 | + if ($level == 0){ |
|
46 | 46 | return ''; |
47 | 47 | } |
48 | 48 |
@@ -42,7 +42,8 @@ |
||
42 | 42 | */ |
43 | 43 | public function indent(int $level): string |
44 | 44 | { |
45 | - if ($level == 0) { |
|
45 | + if ($level == 0) |
|
46 | + { |
|
46 | 47 | return ''; |
47 | 48 | } |
48 | 49 |