Completed
Pull Request — master (#133)
by Simone
01:53
created

SomeApiRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 38
c 0
b 0
f 0
rs 10
1
<?php
2
3
/**
4
 * This file is part of sensorario/resources repository
5
 *
6
 * (c) Simone Gentili <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Resources;
13
14
use Sensorario\Resources\Resource;
15
16
final class SomeApiRequest extends Resource
17
{
18
    const SOME_API_PARAMETER = 'someApiParameter';
19
    const FIELDS             = 'fields';
20
21
    public function mandatory()
22
    {
23
        return [
24
            SomeApiRequest::SOME_API_PARAMETER,
25
        ];
26
    }
27
28
    public function allowed()
29
    {
30
        return [
31
            SomeApiRequest::FIELDS,
32
        ];
33
    }
34
35
    public function allowedValues()
36
    {
37
        return [
38
            SomeApiRequest::SOME_API_PARAMETER => [
39
                'hello',
40
                'world'
41
            ],
42
        ];
43
    }
44
45
    public function rules()
46
    {
47
        return [
48
            SomeApiRequest::FIELDS => [
49
                'scalar' => 'array'
50
            ]
51
        ];
52
    }
53
}
54