Completed
Push — develop ( 31172b...391356 )
by Abdelrahman
01:19
created

Testimonial::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Testimonials\Models;
6
7
use Rinvex\Tenants\Traits\Tenantable;
8
use Spatie\Activitylog\Traits\LogsActivity;
9
use Rinvex\Testimonials\Models\Testimonial as BaseTestimonial;
10
11
/**
12
 * Cortex\Testimonials\Models\Testimonial.
13
 *
14
 * @property int                                                                             $id
15
 * @property int                                                                             $subject_id
16
 * @property string                                                                          $subject_type
17
 * @property int                                                                             $attestant_id
18
 * @property string                                                                          $attestant_type
19
 * @property bool                                                                            $is_approved
20
 * @property string                                                                          $body
21
 * @property \Carbon\Carbon|null                                                             $created_at
22
 * @property \Carbon\Carbon|null                                                             $updated_at
23
 * @property \Carbon\Carbon|null                                                             $deleted_at
24
 * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent                              $attestant
25
 * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent                              $subject
26
 * @property \Illuminate\Database\Eloquent\Collection|\Cortex\Tenants\Models\Tenant[]        $tenants
27
 *
28
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial approved()
29
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial disapproved()
30
 * @method static \Illuminate\Database\Eloquent\Builder|\Rinvex\Testimonials\Models\Testimonial whereAttestantId($value)
31
 * @method static \Illuminate\Database\Eloquent\Builder|\Rinvex\Testimonials\Models\Testimonial whereAttestantType($value)
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 122 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
32
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereBody($value)
33
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereCreatedAt($value)
34
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereDeletedAt($value)
35
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereId($value)
36
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereIsApproved($value)
37
 * @method static \Illuminate\Database\Eloquent\Builder|\Rinvex\Testimonials\Models\Testimonial whereSubjectId($value)
38
 * @method static \Illuminate\Database\Eloquent\Builder|\Rinvex\Testimonials\Models\Testimonial whereSubjectType($value)
39
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereUpdatedAt($value)
40
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial withAllTenants($tenants, $group = null)
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 135 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
41
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial withAnyTenants($tenants, $group = null)
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 135 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
42
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial withTenants($tenants, $group = null)
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 132 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
43
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial withoutAnyTenants()
44
 * @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial withoutTenants($tenants, $group = null)
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 135 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
45
 * @mixin \Eloquent
46
 */
47
class Testimonial extends BaseTestimonial
48
{
49
    use Tenantable;
50
    use LogsActivity;
51
52
    /**
53
     * Indicates whether to log only dirty attributes or all.
54
     *
55
     * @var bool
56
     */
57
    protected static $logOnlyDirty = true;
58
59
    /**
60
     * The attributes that are logged on change.
61
     *
62
     * @var array
63
     */
64
    protected static $logAttributes = [
65
        'subject_id',
66
        'subject_type',
67
        'attestant_id',
68
        'attestant_type',
69
        'is_approved',
70
        'body',
71
    ];
72
73
    /**
74
     * The attributes that are ignored on change.
75
     *
76
     * @var array
77
     */
78
    protected static $ignoreChangedAttributes = [
0 ignored issues
show
Comprehensibility Naming introduced by
The variable name $ignoreChangedAttributes exceeds the maximum configured length of 20.

Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.

Loading history...
79
        'created_at',
80
        'updated_at',
81
        'deleted_at',
82
    ];
83
}
84