Passed
Push — master ( 369e19...ee79b9 )
by Travis
02:23
created

PostRuleSet   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A provideCreationRules() 0 8 1
A provideRules() 0 10 1
A provideUpdateRules() 0 7 1
1
<?php
2
3
namespace Telkins\Validation\Tests\TestRuleSets;
4
5
use Telkins\Validation\AbstractResourceRuleSet;
6
7
class PostRuleSet extends AbstractResourceRuleSet
8
{
9
    protected function provideRules() : array
10
    {
11
        return [
12
            'subject' => [
13
                'string',
14
                'max:255',
15
            ],
16
            'body' => [
17
                'string',
18
                'max:1024',
19
            ],
20
        ];
21
    }
22
23
    protected function provideCreationRules() : array
24
    {
25
        return [
26
            'author_id' => [
27
                'required',
28
            ],
29
            'subject' => [
30
                'required',
31
            ],
32
            // 'body' => [
33
            // ],
34
        ];
35
    }
36
37
    protected function provideUpdateRules() : array
38
    {
39
        return [
40
            'reason' => [
41
                'required',
42
                'string',
43
                'max:255',
44
            ],
45
        ];
46
    }
47
}
48