DeleteOperation   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A railway() 0 5 1
A __invoke() 0 4 1
A delete() 0 6 1
1
<?php
2
3
use einfach\operation\{Railway, Result};
4
use function einfach\operation\response\{ok, error};
5
6
class DeleteOperation extends ReadOperation implements \einfach\operation\IOperation
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
{
8
    public function railway() : Railway
9
    {
10
        return parent::railway()
11
            ->step([$this, 'delete']);
12
    }
13
14
    public function __invoke(array $params) : Result
15
    {
16
        return $this->railway()->runWithParams($params);
17
    }
18
19
    public function delete($params)
20
    {
21
        // pretend it is deleted from DB
22
        unset($params['model']);
23
        return ok($params);
24
    }
25
}
26