Passed
Push — main ( 09bb15...4e48df )
by Richard
05:57
created

HouseAd   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getUrlImageLandscapeAttribute() 0 3 1
A getUrlImagePortraitAttribute() 0 3 1
A stat() 0 3 1
1
<?php
2
3
namespace Furic\HouseAds\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class HouseAd extends Model
8
{
9
10
    protected $guarded = [];
11
12
    protected $hidden = ['image_portrait', 'image_landscape', 'confirmed_count', 'cancelled_count', 'created_at', 'updated_at'];
13
14
    protected $appends = ['url_image_portrait', 'url_image_landscape'];
15
16
    public function getUrlImagePortraitAttribute()
17
    {
18
        return public_path().'/images/'.$this->image_portrait;
19
    }
20
21
    public function getUrlImageLandscapeAttribute()
22
    {
23
        return public_path().'/images/'.$this->image_landscape;
24
    }
25
26
    public function stat()
27
    {
28
        return $this->hasOne(HouseAdsStat::class);
0 ignored issues
show
Bug introduced by
The type Furic\HouseAds\Models\HouseAdsStat 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...
29
    }
30
31
}
32