Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3 * Jingga
4 *
5 * PHP Version 8.1
6 *
7 * @package   phpOMS\Config
8 * @copyright Dennis Eichhorn
9 * @license   OMS License 2.0
10 * @version   1.0.0
11 * @link      https://jingga.app
12 */
13declare(strict_types=1);
14
15namespace phpOMS\Config;
16
17/**
18 * Options class.
19 *
20 * @package phpOMS\Config
21 * @license OMS License 2.0
22 * @link    https://jingga.app
23 * @since   1.0.0
24 */
25interface OptionsInterface
26{
27    /**
28     * Is this key set.
29     *
30     * @param int|string $key Key to check for existence
31     *
32     * @return bool
33     *
34     * @since 1.0.0
35     */
36    public function exists(int | string $key) : bool;
37
38    /**
39     * Updating or adding settings.
40     *
41     * @param int|string $key       Unique option key
42     * @param mixed      $value     Option value
43     * @param bool       $overwrite Overwrite existing value
44     *
45     * @return bool
46     *
47     * @since 1.0.0
48     */
49    public function setOption(int | string $key, mixed $value, bool $overwrite = true) : bool;
50
51    /**
52     * Updating or adding settings.
53     *
54     * @param array $pair      Key value pair
55     * @param bool  $overwrite Overwrite existing value
56     *
57     * @return bool
58     *
59     * @since 1.0.0
60     */
61    public function setOptions(array $pair, bool $overwrite = true) : bool;
62
63    /**
64     * Get option by key.
65     *
66     * @param int|string $key Unique option key
67     *
68     * @return mixed Option value
69     *
70     * @since 1.0.0
71     */
72    public function getOption(int | string $key) : mixed;
73}