1 | <?php |
||
11 | class Settings extends Component |
||
12 | { |
||
13 | /** |
||
14 | * @event SettingsEvent an event that is triggered before execute command. |
||
15 | */ |
||
16 | const EVENT_BEFORE_EXECUTE = 'beforeExecute'; |
||
17 | |||
18 | /** |
||
19 | * @var string Name of the table where configurations will be stored |
||
20 | */ |
||
21 | public $tableName = '{{%setting}}'; |
||
22 | |||
23 | /** |
||
24 | * @var string Name of column where keys will be stored |
||
25 | */ |
||
26 | public $keyColumnName = 'key'; |
||
27 | |||
28 | /** |
||
29 | * @var string Name of column where values will be stored |
||
30 | */ |
||
31 | public $valueColumnName = 'value'; |
||
32 | |||
33 | /** |
||
34 | * @return Connection the DB connection instance |
||
35 | */ |
||
36 | 2 | protected function getDb() |
|
40 | |||
41 | /** |
||
42 | * Whether the configuration exists in the database |
||
43 | * @param string $name configuration name |
||
44 | * @param integer $tenantId The tenant id value |
||
|
|||
45 | * @return bool |
||
46 | */ |
||
47 | 2 | protected function exists($name) |
|
52 | |||
53 | /** |
||
54 | * Returns configuration value from database |
||
55 | * @param string $name configuration name |
||
56 | * @return string value stored in database |
||
57 | */ |
||
58 | 1 | public function get($name, $defaultValue = null) |
|
72 | |||
73 | /** |
||
74 | * Store configuration value to database |
||
75 | * @param string $name |
||
76 | * @param mixed $value |
||
77 | */ |
||
78 | 2 | public function set($name, $value) |
|
102 | |||
103 | /** |
||
104 | * Retrieves all configurations stored in database |
||
105 | * @param integer $tenantId |
||
106 | * @return array |
||
107 | */ |
||
108 | 1 | public function all() |
|
123 | |||
124 | /** |
||
125 | * Store all configuration in database |
||
126 | * @param array $names |
||
127 | */ |
||
128 | 1 | public function save($names) |
|
134 | |||
135 | /** |
||
136 | * Remove specified setting |
||
137 | * @param array|string $name |
||
138 | */ |
||
139 | 1 | public function remove($name) |
|
153 | |||
154 | /** |
||
155 | * Removes all settings |
||
156 | */ |
||
157 | 1 | public function removeAll() |
|
167 | |||
168 | /** |
||
169 | * Creates query to find settings value |
||
170 | * @param string $name |
||
171 | * @return \yii\db\Query |
||
172 | */ |
||
173 | 2 | protected function createQuery($name = null) |
|
191 | |||
192 | /** |
||
193 | * This method is called at the before execute db command |
||
194 | * @return yii\base\Event |
||
195 | */ |
||
196 | 2 | protected function beforeExecute() |
|
202 | |||
203 | } |
||
204 |
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 methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.