Skip to content

Commit 79837c9

Browse files
committed
Removes SensitiveValue code
I no longer believe this is a problem the framework should solve.
1 parent d8a57e6 commit 79837c9

File tree

2 files changed

+1
-45
lines changed

2 files changed

+1
-45
lines changed

src/Contexts/HasData.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@
66

77
use SlackPhp\Framework\Exception;
88

9-
use const ARRAY_FILTER_USE_KEY;
10-
119
trait HasData
1210
{
1311
/** @var array<string, mixed> */
1412
protected array $data = [];
1513

16-
/** @var array<string, bool> */
17-
protected array $sensitive = [];
18-
1914
/**
2015
* This constructor can (and likely should be) be overridden by trait users.
2116
*
@@ -33,11 +28,6 @@ private function setData(array $data): void
3328
continue;
3429
}
3530

36-
if ($value instanceof SensitiveValue) {
37-
$this->sensitive[$key] = true;
38-
$value = $value->getRawValue();
39-
}
40-
4131
$this->data[$key] = $value;
4232
}
4333
}
@@ -149,7 +139,7 @@ private function getDeep(array $keys, array &$data)
149139
*/
150140
public function toArray(): array
151141
{
152-
return array_filter($this->data, fn (string $key) => !isset($this->sensitive[$key]), ARRAY_FILTER_USE_KEY);
142+
return $this->data;
153143
}
154144

155145
public function jsonSerialize()

src/Contexts/SensitiveValue.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)