These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * @author Anton Tuyakhov <[email protected]> |
||
4 | */ |
||
5 | |||
6 | namespace tuyakhov\jsonapi; |
||
7 | |||
8 | /** |
||
9 | * Interface for a “resource object” that represent an individual resource. |
||
10 | */ |
||
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); |
||
0 ignored issues
–
show
|
|||
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.