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

AbstractResourceRuleSet::updateRules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Telkins\Validation;
4
5
use Illuminate\Support\Str;
6
use Telkins\Validation\Contracts\ResourceRuleSetContract;
7
8
abstract class AbstractResourceRuleSet implements ResourceRuleSetContract
9
{
10
    public function rules() : array
11
    {
12
        return $this->provideRules();
13
    }
14
15
    public function creationRules() : array
16
    {
17
        return array_merge_recursive(
18
            $this->provideRules(),
19
            $this->provideCreationRules()
20
        );
21
    }
22
23
    public function updateRules() : array
24
    {
25
        return array_merge_recursive(
26
            $this->provideRules(),
27
            $this->provideUpdateRules()
28
        );
29
    }
30
31
    abstract protected function provideRules() : array;
32
33
    abstract protected function provideCreationRules() : array;
34
35
    abstract protected function provideUpdateRules() : array;
36
}
37