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

EloquentSituations   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 8
dl 0
loc 19
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 3 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