LeagueTeam   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A league() 0 3 1
A users() 0 3 1
A movies() 0 3 1
1
<?php
2
3
/**
4
 * LeagueTeam
5
 *
6
 * @property integer        $id
7
 * @property integer        $league_id
8
 * @property string         $name
9
 * @property \Carbon\Carbon $created_at
10
 * @property \Carbon\Carbon $updated_at
11
 * @method static \Illuminate\Database\Query\Builder|\LeagueTeam whereId($value)
12
 * @method static \Illuminate\Database\Query\Builder|\LeagueTeam whereLeagueId($value)
13
 * @method static \Illuminate\Database\Query\Builder|\LeagueTeam whereName($value)
14
 * @method static \Illuminate\Database\Query\Builder|\LeagueTeam whereCreatedAt($value)
15
 * @method static \Illuminate\Database\Query\Builder|\LeagueTeam whereUpdatedAt($value)
16
 * @property-read \League   $league
17
 * @property-read \Illuminate\Database\Eloquent\Collection|\User[] $users
18
 * @property-read \Illuminate\Database\Eloquent\Collection|\LeagueMovie[] $movies
19
 */
20
class LeagueTeam 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...
21
22
	protected $fillable = ['name'];
23
24
	/**
25
	 * The league this team is in
26
	 *
27
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
28
	 */
29
	public function league() {
30
		return $this->belongsTo('League');
31
	}
32
33
	/**
34
	 * The users that are in this team
35
	 *
36
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
37
	 */
38 9
	public function users() {
39 9
		return $this->belongsToMany('User')->withTimestamps();
40
	}
41
42
	/**
43
	 * The movies this team owns
44
	 *
45
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
46
	 */
47 9
	public function movies() {
48 9
		return $this->belongsToMany('LeagueMovie', 'league_team_movies')->withTimestamps();
49
	}
50
}