Completed
Push — master ( a7ae23...b30b3b )
by Thomas
09:53
created

LanguageVariantSerializerTrait::getFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace keeko\core\serializer\base;
3
4
/**
5
 */
6
trait LanguageVariantSerializerTrait {
7
8
	/**
9
	 * @param mixed $model
10
	 * @param array $fields
11
	 */
12
	public function getAttributes($model, array $fields = null) {
1 ignored issue
show
Unused Code introduced by
The parameter $fields is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
13
		return [
14
			'id' => $model->Id(),
15
			'name' => $model->Name(),
16
			'subtag' => $model->Subtag(),
17
			'prefixes' => $model->Prefixes(),
18
			'comment' => $model->Comment(),
19
		];
20
	}
21
22
	/**
23
	 */
24
	public function getFields() {
25
		return ['id', 'name', 'subtag', 'prefixes', 'comment'];
26
	}
27
28
	/**
29
	 * @param mixed $model
30
	 */
31
	public function getId($model) {
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
32
		return $model->getId();
33
	}
34
35
	/**
36
	 */
37
	public function getSortFields() {
38
		return ['id', 'name', 'subtag', 'prefixes', 'comment'];
39
	}
40
41
	/**
42
	 * @param mixed $model
43
	 */
44
	public function getType($model) {
1 ignored issue
show
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
45
		return 'core/language-variant';
46
	}
47
48
	/**
49
	 * @param mixed $model
50
	 * @param mixed $data
51
	 */
52
	public function hydrate($model, $data) {
1 ignored issue
show
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
53
		// this model is read-only!
54
		return $model;
55
	}
56
}
57