Restore   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

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

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

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...
26
    }
27
}
28