blob: 06413291d93b0a4b081d56e372b30257b2182476 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<?php
declare(strict_types=1);
namespace DTS;
class Old
{
const FIELDS = [
'task',
'tag',
];
private array $old = [];
function __construct(array $request = [])
{
foreach(self::FIELDS as $field) {
if (array_key_exists($field, $request)) {
$this->old[$field] = $request[$field];
}
}
}
public function get(string $key, $default = null)
{
return $this->old[$key] ?? $default;
}
}
|