Test Failed
Push — master ( f562c0...ed7d3a )
by Dominik
02:11
created

CourseSearchMapping::getClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ApiSkeleton\Deserialization;
6
7
use Chubbyphp\Deserialization\Mapping\ObjectMappingInterface;
8
use Chubbyphp\Deserialization\Mapping\PropertyMapping;
9
use Chubbyphp\Deserialization\Mapping\PropertyMappingInterface;
10
use Chubbyphp\ApiSkeleton\Search\CourseSearch;
11
12
final class CourseSearchMapping implements ObjectMappingInterface
13
{
14
    /**
15
     * @return string
16
     */
17
    public function getClass(): string
18
    {
19
        return CourseSearch::class;
20
    }
21
22
    /**
23
     * @return callable
24
     */
25
    public function getFactory(): callable
26
    {
27
        return [CourseSearch::class, 'create'];
28
    }
29
30
    /**
31
     * @return PropertyMappingInterface[]
32
     */
33
    public function getPropertyMappings(): array
34
    {
35
        return [
36
            new PropertyMapping('page'),
37
            new PropertyMapping('perPage'),
38
            new PropertyMapping('sort'),
39
            new PropertyMapping('order'),
40
        ];
41
    }
42
}
43