| 1 | <?php |
||
| 5 | class Config { |
||
| 6 | |||
| 7 | private $config = [], $values = []; |
||
| 8 | |||
| 9 | # Add rule |
||
| 10 | |||
| 11 | public function add(string $name, $default, callable $handler) { |
||
| 19 | |||
| 20 | # Set array of values |
||
| 21 | |||
| 22 | public function set(array $data) { |
||
| 33 | |||
| 34 | # Cast array of values |
||
| 35 | |||
| 36 | public function cast(array $data, bool $process_all = false) { |
||
| 53 | |||
| 54 | # Get value or array of values |
||
| 55 | |||
| 56 | public function get(string $name = null) { |
||
| 62 | |||
| 63 | # Setter |
||
| 64 | |||
| 65 | public function __set(string $name, $value) { |
||
| 69 | |||
| 70 | # Getter |
||
| 71 | |||
| 72 | public function __get(string $name) { |
||
| 76 | } |
||
| 77 | } |
||
| 78 |