Passed
Branch feature/ide (e899a2)
by Csaba
02:33
created

FooSchema   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 54
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Fathomminds\Rest\Examples\DynamoDb\Models\Schema;
3
4
use Fathomminds\Rest\Schema;
5
use Fathomminds\Rest\Schema\TypeValidators\StringValidator;
6
use Fathomminds\Rest\Schema\TypeValidators\IntegerValidator;
7
use Fathomminds\Rest\Examples\DynamoDb\Models\Schema\BarSchema;
8
9
/**
10
 *
11
 * @property string $_id
12
 * @property string $title
13
 * @property string $other
14
 * @property string $noindex
15
 * @property integer $status
16
 * @property BarSchema $bar
17
 *
18
 */
19
20
class FooSchema extends Schema
21
{
22
    public function schema()
23
    {
24
        return [
25
            '_id' => [
26
                'unique' => true,
27
                'validator' => [
28
                    'class' => StringValidator::class,
29
                ]
30
            ],
31
            'title' => [
32
                'unique' => true,
33
                'required' => true,
34
                'validator' => [
35
                    'class' => StringValidator::class,
36
                    'params' => [
37
                        'maxLength' => 100,
38
                    ],
39
                ],
40
            ],
41
            'other' => [
42
                'unique' => true,
43
                'validator' => [
44
                    'class' => StringValidator::class,
45
                    'params' => [
46
                        'maxLength' => 100,
47
                    ],
48
                ],
49
            ],
50
            'noindex' => [
51
                'unique' => true,
52
                'validator' => [
53
                    'class' => StringValidator::class,
54
                    'params' => [
55
                        'maxLength' => 100,
56
                    ],
57
                ],
58
            ],
59
            'status' => [
60
                'validator' => [
61
                    'class' => IntegerValidator::class,
62
                    'params' => [
63
                        'min' => 0,
64
                        'max' => 1,
65
                    ],
66
                ],
67
            ],
68
            'bar' => [
69
                'type' => BarSchema::class,
70
            ],
71
        ];
72
    }
73
}
74