ConfigInterface::all()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of Fabrica.
5
 *
6
 * (c) Alexandre Salomé <[email protected]>
7
 * (c) Julien DIDIER <[email protected]>
8
 *
9
 * This source file is subject to the GPL license that is bundled
10
 * with this source code in the file LICENSE.
11
 */
12
13
namespace Fabrica\Component\Config;
14
15
/**
16
 * Interface for dynamic configuration of Fabrica.
17
 *
18
 * This configuration is basically a key-value storage or scalars.
19
 *
20
 * @author Alexandre Salomé <[email protected]>
21
 */
22
interface ConfigInterface
23
{
24
    /**
25
     * Fetch a configuration value.
26
     *
27
     * @param string $key     Key value
28
     * @param mixed  $default Value to return if nothing is found in confiugration
29
     *
30
     * @return mixed Value if exists, $default otherwise
31
     */
32
    public function get($key, $default = null);
33
34
    /**
35
     * Set a configuration value.
36
     *
37
     * @param string $key   Key of the value to set
38
     * @param mixed  $value Value to set
39
     */
40
    public function set($key, $value);
41
42
    /**
43
     * Removes a given value from config.
44
     *
45
     * @param string $value The key of value to remove.
0 ignored issues
show
Bug introduced by
There is no parameter named $value. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
46
     */
47
    public function remove($key);
48
49
    /**
50
     * Returns all values.
51
     *
52
     * @return array All values
53
     */
54
    public function all();
55
56
    /**
57
     * Replaces all values with given one.
58
     */
59
    public function setAll(array $values);
60
61
    /**
62
     * Merge values in current config
63
     */
64
    public function merge(array $values);
65
}
66