Failed Conditions
Pull Request — master (#321)
by Anton
23:35 queued 08:33
created

Row::beforeSave()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
c 0
b 0
f 0
cc 1
crap 2
rs 10
1
<?php
2
/**
3
 * @copyright Bluz PHP Team
4
 * @link      https://github.com/bluzphp/skeleton
5
 */
6
7
declare(strict_types=1);
8
9
namespace Application\UsersActions;
10
11
/**
12
 * Row of User Actions
13
 *
14
 * @package  Application\Users
15
 *
16
 * @property integer $userId
17
 * @property string $code
18
 * @property string $action
19
 * @property string $params
20
 * @property string $created
21
 * @property string $expired
22
 */
23
class Row extends \Bluz\Db\Row
0 ignored issues
show
Bug introduced by
The type Bluz\Db\Row 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...
24
{
25
    /**
26
     * beforeSave
27
     *
28
     * @return void
29
     */
30
    public function beforeSave(): void
31
    {
32
        $this->params = serialize($this->params);
33
    }
34
35
    /**
36
     * Return params of token
37
     *
38
     * @return array
39
     */
40
    public function getParams(): array
41
    {
42
        return $this->params ? unserialize($this->params, ['allowed_classes' => false]) : [];
43
    }
44
}
45