Completed
Push — master ( c45904...04afc3 )
by Iman
03:46
created

EloquentSituations::normalize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Imanghafoori\HeyMan\Plugins\WatchingStrategies\EloquentModels;
4
5
final class EloquentSituations
6
{
7
    protected $methods = [
8
        'whenYouFetch'  => 'retrieved',
9
        'whenYouCreate' => 'creating',
10
        'whenYouUpdate' => 'updating',
11
        'whenYouSave'   => 'saving',
12
        'whenYouDelete' => 'deleting',
13
    ];
14
15
    /**
16
     * @param $method
17
     * @param $model
18
     *
19
     * @return array
20
     */
21 17
    public function normalize($method, $model): array
22
    {
23 17
        return [$model, $this->methods[$method]];
24
    }
25
}
26