Movie   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 41
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A earnings() 0 3 1
A latestEarnings() 0 3 1
A leagues() 0 3 1
1
<?php
2
3
/**
4
 * Movie
5
 *
6
 * @property integer                                                       $id
7
 * @property string                                                        $name
8
 * @property string                                                        $boxmojo_id
9
 * @property string                                                        $boxoffice_id
10
 * @property \Carbon\Carbon                                                $release
11
 * @property integer                                                       $latest_earnings_id
12
 * @property \Carbon\Carbon                                                $created_at
13
 * @property \Carbon\Carbon                                                $updated_at
14
 * @property-read \Illuminate\Database\Eloquent\Collection|\MovieEarning[] $earnings
15
 * @property-read \MovieEarning                                            $latestEarnings
16
 * @method static \Illuminate\Database\Query\Builder|\Movie whereId($value)
17
 * @method static \Illuminate\Database\Query\Builder|\Movie whereName($value)
18
 * @method static \Illuminate\Database\Query\Builder|\Movie whereBoxmojoId($value)
19
 * @method static \Illuminate\Database\Query\Builder|\Movie whereRelease($value)
20
 * @method static \Illuminate\Database\Query\Builder|\Movie whereLatestEarningsId($value)
21
 * @method static \Illuminate\Database\Query\Builder|\Movie whereCreatedAt($value)
22
 * @method static \Illuminate\Database\Query\Builder|\Movie whereUpdatedAt($value)
23
 * @method static \Illuminate\Database\Query\Builder|\Movie whereBoxofficeId($value)
24
 * @property-read \Illuminate\Database\Eloquent\Collection|\League[] $leagues
25
 */
26
class Movie extends Eloquent {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
27
28
	/**
29
	 * Fields to format as dates
30
	 * @var array
31
	 */
32
	protected $dates = ['release'];
33
34
	/**
35
	 * Allow filling of these fields
36
	 * @var array
37
	 */
38
	protected $fillable = ['name', 'boxmojo_id', 'boxoffice_id', 'release'];
39
40
	/**
41
	 * All movie's earnings
42
	 *
43
	 * @return \Illuminate\Database\Eloquent\Relations\HasMany
44
	 */
45
	public function earnings() {
46
		return $this->hasMany('MovieEarning');
47
	}
48
49
	/**
50
	 * Movie's latest earnings
51
	 *
52
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
53
	 */
54
	public function latestEarnings() {
55
		return $this->belongsTo('MovieEarning');
56
	}
57
58
	/**
59
	 * Leagues this movie is used in
60
	 *
61
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
62
	 */
63
	public function leagues() {
64
		return $this->belongsToMany('League', 'league_movies');
65
	}
66
}