Passed
Push — master ( c2b947...93db86 )
by Carlos
02:53
created

SoftDelete::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2.0625

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 2
nop 1
dl 0
loc 14
ccs 6
cts 8
cp 0.75
crap 2.0625
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A SoftDelete::proct() 0 3 1
1
<?php
2
3
namespace roaresearch\yii2\roa\actions;
4
5
use roaresearch\yii2\roa\hal\ARContract;
6
7
/**
8
 * Deletes a record using the `softDelete()` method. Meant to be used with
9
 * library "yii2tech/ar-softdelete".
10
 *
11
 * @author Angel (Faryshta) Guevara <[email protected]>
12
 */
13
class SoftDelete extends ProctRecordAction
14
{
15
    use DeleteResponseTrait;
16
17
    /**
18
     * @inheritdoc
19
     */
20
    protected string $errorMessage = 'Soft Delete failed for unknown reasons.';
21
22
    /**
23
     * @inheritdoc
24
     */
25 2
    protected function proct(ARContract $model, array $params): bool
26
    {
27 2
        return false !== $model->softDelete();
0 ignored issues
show
Bug introduced by
The method softDelete() does not exist on roaresearch\yii2\roa\hal\ARContract. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        return false !== $model->/** @scrutinizer ignore-call */ softDelete();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
    }
29
}
30