1 | <?php |
||
21 | class Resources |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $resources = array(); |
||
28 | |||
29 | /** |
||
30 | * @var EntityInterface |
||
31 | */ |
||
32 | protected $entity = null; |
||
33 | |||
34 | /** |
||
35 | * Sets an entity object. |
||
36 | * |
||
37 | * @param EntityInterface $entity An entity object |
||
38 | */ |
||
39 | public function setEntity(EntityInterface $entity) |
||
43 | |||
44 | /** |
||
45 | * Gets the current entity object. |
||
46 | * |
||
47 | * @return EntityInterface |
||
48 | */ |
||
49 | public function getEntity() |
||
53 | |||
54 | /** |
||
55 | * Adds a resource entity. |
||
56 | * |
||
57 | * @param string $name A resource name |
||
58 | * @param array $resource A resource definition array |
||
|
|||
59 | * @return Entity |
||
60 | */ |
||
61 | public function add($name, array $resources) |
||
88 | |||
89 | /** |
||
90 | * Checks wether a specified resource name exists. |
||
91 | * |
||
92 | * @param string $name The resource name to check |
||
93 | * @return boolean |
||
94 | */ |
||
95 | public function has($name) |
||
99 | |||
100 | /** |
||
101 | * Returns all the resources. |
||
102 | * |
||
103 | * @return array The array of resources |
||
104 | */ |
||
105 | public function toArray() |
||
109 | |||
110 | /** |
||
111 | * Gets the specified resource entity. |
||
112 | * |
||
113 | * @param string $name The resource name to retrieve. |
||
114 | * @throws /DomainException 404 |
||
115 | * @return Entity/EntityInterface |
||
116 | */ |
||
117 | public function getResource($name) |
||
127 | |||
128 | /** |
||
129 | * Gets the specified ressource entity from a route object. |
||
130 | * |
||
131 | * @param Router $route The resource route object. |
||
132 | * @param boolean $follow Wether to handle the default actions. |
||
133 | * @throws /DomainException 404 |
||
134 | * @return Entity/EntityInterface |
||
135 | */ |
||
136 | public function get(Router &$route, $follow=true) |
||
170 | |||
171 | } |
||
172 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.