PostRuleSet   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 18
c 2
b 0
f 0
dl 0
loc 35
rs 10
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
        ];
33
    }
34
35
    protected function provideUpdateRules() : array
36
    {
37
        return [
38
            'reason' => [
39
                'required',
40
                'string',
41
                'max:255',
42
            ],
43
        ];
44
    }
45
}
46