EloquentSituations::normalize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
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
     * @return array
19
     */
20
    public function normalize($method, $model)
21 15
    {
22
        return [$model, $this->methods[$method]];
23 15
    }
24
}
25