Test Failed
Push — master ( 5904eb...0e6af8 )
by Phaniraj
05:25
created

Import::importLogs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace LWS\ImportExport\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Import extends Model
8
{
9
    protected $fillable = ['file', 'file_rows', 'db_cols', 'row_processed'];
10
11
    /**
12
     * Relationship with import export log model.
13
     *
14
     * @return void
15
     */
16
    public function importLogs()
17
    {
18
        return $this->hasMany(\Ladybirdweb\ImportExport\Models\ImportExportLog::class, 'op_id');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->hasMany(La...ortLog::class, 'op_id') returns the type Illuminate\Database\Eloquent\Relations\HasMany which is incompatible with the documented return type void.
Loading history...
Bug introduced by
The type Ladybirdweb\ImportExport\Models\ImportExportLog 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...
19
    }
20
21
    /**
22
     * Model Map accessor.
23
     *
24
     * Unserialize model map while retriving.
25
     * @param $value
26
     * @return string
27
     */
28
    public function getModelMapAttribute($value)
29
    {
30
        return unserialize($value);
31
    }
32
33
    /**
34
     * Model Map mulator.
35
     *
36
     * Serialize model map while storing.
37
     * @param $value
38
     * @return void
39
     */
40
    public function setModelMapAttribute($value)
41
    {
42
        $this->attributes['model_map'] = serialize($value);
43
    }
44
45
    /**
46
     * DB cols accessor.
47
     *
48
     * Unserialize model map while retriving.
49
     * @param $value
50
     * @return string
51
     */
52
    public function getDbColsAttribute($value)
53
    {
54
        return unserialize($value);
55
    }
56
57
    /**
58
     * Model Map mulator.
59
     *
60
     * Serialize model map while storing.
61
     * @param $value
62
     * @return void
63
     */
64
    public function setDbColsAttribute($value)
65
    {
66
        $this->attributes['db_cols'] = serialize($value);
67
    }
68
}
69