Asset   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 20
c 4
b 0
f 0
dl 0
loc 43
ccs 0
cts 3
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUrl() 0 3 1
1
<?php
2
3
namespace Distilleries\Contentful\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Distilleries\Contentful\Models\Traits\Localable;
7
8
/**
9
 * @property string $contentful_id
10
 * @property string $locale
11
 * @property string $country
12
 * @property string $title
13
 * @property string $description
14
 * @property string $url
15
 * @property string $file_name
16
 * @property string $content_type
17
 * @property integer $size
18
 * @property integer $width
19
 * @property integer $height
20
 * @property \Illuminate\Support\Carbon $created_at
21
 * @property \Illuminate\Support\Carbon $updated_at
22
 */
23
class Asset extends Model
24
{
25
    use Localable;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected $table = 'assets';
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    protected $fillable = [
36
        'contentful_id',
37
        'locale',
38
        'country',
39
        'title',
40
        'description',
41
        'url',
42
        'file_name',
43
        'content_type',
44
        'size',
45
        'width',
46
        'height',
47
    ];
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    protected $casts = [
53
        'size' => 'integer',
54
        'width' => 'integer',
55
        'height' => 'integer',
56
    ];
57
58
    /**
59
     * Return asset URL.
60
     *
61
     * @return string|null
62
     */
63
    public function getUrl(): ?string
64
    {
65
        return $this->url;
66
    }
67
}
68