H5pContent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
eloc 26
dl 0
loc 35
c 1
b 1
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_user() 0 3 1
A user() 0 3 1
1
<?php
2
3
namespace Djoudi\LaravelH5p\Eloquents;
4
5
use App\User;
0 ignored issues
show
Bug introduced by
The type App\User 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...
6
use DB;
7
use Illuminate\Database\Eloquent\Model;
8
9
//use App\Models\User;
10
11
class H5pContent extends Model
12
{
13
    protected $primaryKey = 'id';
14
    protected $fillable = [
15
        'user_id',
16
        'title',
17
        'library_id',
18
        'parameters',
19
        'filtered',
20
        'slug',
21
        'embed_type',
22
        'disable',
23
        'content_type',
24
        'author',
25
        'source',
26
        'year_from',
27
        'year_to',
28
        'license',
29
        'license_version',
30
        'license_extras',
31
        'author_comments',
32
        'changes',
33
        'default_languge',
34
        'keywords',
35
        'description',
36
    ];
37
38
    public function user()
39
    {
40
        return $this->belongsTo(User::class);
41
    }
42
43
    public function get_user()
44
    {
45
        return (object) DB::table('users')->where('id', $this->user_id)->first();
46
    }
47
}
48