Sermon   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 42
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getFileName() 0 3 1
A filesDir() 0 3 1
A getSermonAttribute() 0 3 1
A getPreacherAttribute() 0 3 1
A formatVerse() 0 5 1
1
<?php
2
3
namespace FaithGen\Sermons\Models;
4
5
use FaithGen\SDK\Models\UuidModel;
6
use FaithGen\SDK\Traits\Relationships\Belongs\BelongsToMinistryTrait;
7
use FaithGen\SDK\Traits\Relationships\Morphs\CommentableTrait;
8
use FaithGen\SDK\Traits\Relationships\Morphs\ImageableTrait;
9
use FaithGen\SDK\Traits\StorageTrait;
10
use FaithGen\SDK\Traits\TitleTrait;
11
12
class Sermon extends UuidModel
13
{
14
    use  CommentableTrait, BelongsToMinistryTrait, StorageTrait, TitleTrait, ImageableTrait;
15
16
    protected $table = 'fg_sermons';
17
    protected $casts = [
18
        'main_verses' => 'array',
19
        'reference_verses' => 'array',
20
    ];
21
22
    //****************************************************************************//
23
    //***************************** MODEL ATTRIBUTES *****************************//
24
    //****************************************************************************//
25
    public function getPreacherAttribute($val)
26
    {
27
        return ucwords($val);
28
    }
29
30
    public function getSermonAttribute($val)
31
    {
32
        return ucfirst($val);
33
    }
34
35
    //****************************************************************************//
36
    //***************************** MODEL ATTRIBUTES *****************************//
37
    //****************************************************************************//
38
39
    public function formatVerse($verse)
40
    {
41
        ucwords($verse);
42
43
        return true;
44
    }
45
46
    public function filesDir()
47
    {
48
        return 'sermons';
49
    }
50
51
    public function getFileName()
52
    {
53
        return $this->image->name;
0 ignored issues
show
Bug introduced by
The property image does not seem to exist on FaithGen\Sermons\Models\Sermon. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
54
    }
55
}
56