Completed
Pull Request — master (#6)
by Angel
03:38
created

Restore::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
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 15
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 Restore::proct() 0 3 1
1
<?php
2
3
namespace roaresearch\yii2\roa\actions;
4
5
use roarsearch\yii2\roa\hal\ARContract;
0 ignored issues
show
Bug introduced by
The type roarsearch\yii2\roa\hal\ARContract was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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 1
     * @inheritdoc
22
     */
23 1
    protected function proct(ARContract $model, array $params): bool
24 1
    {
25 1
        return false !== $model->restore();
26
    }
27
}
28