Total Lines | 19 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | interface ResourceInterface extends ResourceIdentifierInterface |
||
12 | { |
||
13 | /** |
||
14 | * The "attributes" member of the resource object representing some of the resource’s data. |
||
15 | * @param array $fields specific fields that a client has requested. |
||
16 | * @return array an array of attributes that represent information about the resource object in which it’s defined. |
||
17 | */ |
||
18 | public function getResourceAttributes(array $fields = []); |
||
19 | |||
20 | /** |
||
21 | * The "relationships" member of the resource object describing relationships between the resource and other JSON API resources. |
||
22 | * @param null|array $linked specific resource linkage that a client has requested. |
||
23 | * @return ResourceIdentifierInterface[] represent references from the resource object in which it’s defined to other resource objects. |
||
24 | */ |
||
25 | public function getResourceRelationships(array $linked = null); |
||
26 | |||
27 | public function setResourceRelationship($name, $relationship); |
||
28 | |||
29 | } |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@return
doc comment to communicate to implementors of these methods what they are expected to return.