1 | <?php namespace Anomaly\ConfigurationModule\Configuration; |
||
18 | class ConfigurationRepository extends EntryRepository implements ConfigurationRepositoryInterface |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * The configuration model. |
||
23 | * |
||
24 | * @var ConfigurationModel |
||
25 | */ |
||
26 | protected $model; |
||
27 | |||
28 | /** |
||
29 | * The configurations collection. |
||
30 | * |
||
31 | * @var ConfigurationCollection |
||
32 | */ |
||
33 | protected $configurations; |
||
34 | |||
35 | /** |
||
36 | * Create a new ConfigurationRepositoryInterface instance. |
||
37 | * |
||
38 | * @param ConfigurationModel $model |
||
39 | * @param Repository $config |
||
|
|||
40 | * @param FieldTypeCollection $fieldTypes |
||
41 | */ |
||
42 | public function __construct(ConfigurationModel $model) |
||
43 | { |
||
44 | $this->model = $model; |
||
45 | |||
46 | $this->configurations = $this->model->all(); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * Get a configuration. |
||
51 | * |
||
52 | * @param $key |
||
53 | * @param $scope |
||
54 | * @return ConfigurationInterface|null |
||
55 | */ |
||
56 | public function get($key, $scope) |
||
60 | |||
61 | /** |
||
62 | * Set a configurations value. |
||
63 | * |
||
64 | * @param $key |
||
65 | * @param $scope |
||
66 | * @param $value |
||
67 | * @return bool |
||
68 | */ |
||
69 | public function set($key, $scope, $value) |
||
77 | |||
78 | /** |
||
79 | * Get a configuration value. |
||
80 | * |
||
81 | * @param $key |
||
82 | * @param $scope |
||
83 | * @param null $default |
||
84 | * @return mixed|null |
||
85 | */ |
||
86 | public function value($key, $scope, $default = null) |
||
94 | |||
95 | /** |
||
96 | * Get a configuration value presenter instance. |
||
97 | * |
||
98 | * @param $key |
||
99 | * @param $scope |
||
100 | * @return FieldTypePresenter|null |
||
101 | */ |
||
102 | public function presenter($key, $scope) |
||
110 | |||
111 | /** |
||
112 | * Find a configuration by it's key |
||
113 | * or return a new instance. |
||
114 | * |
||
115 | * @param $key |
||
116 | * @param $scope |
||
117 | * @return ConfigurationInterface |
||
118 | */ |
||
119 | public function findByKeyAndScopeOrNew($key, $scope) |
||
131 | |||
132 | /** |
||
133 | * Purge a namespace's configuration. |
||
134 | * |
||
135 | * @param $namespace |
||
136 | * @return $this |
||
137 | */ |
||
138 | public function purge($namespace) |
||
144 | } |
||
145 |
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.