Video   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 28
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUrlTagAttribute() 0 9 3
1
<?php namespace WITR;
2
3
use Illuminate\Database\Eloquent\Model;
4
5
class Video extends Model {
6
7
	/**
8
	 * The database table used by the model.
9
	 *
10
	 * @var string
11
	 */
12
	protected $table = 'videos';
13
14
	/**
15
	 * The attributes that are mass assignable.
16
	 *
17
	 * @var array
18
	 */
19
	protected $fillable = ['artist', 'song', 'album', 'review', 'url_tag'];
20
21
	public $timestamps = false;
22
23
	public function setUrlTagAttribute($value)
24
    {
25
    	parse_str( parse_url( $value, PHP_URL_QUERY ), $params );
26
		if (isset($params['v']) || array_key_exists('v', $params)) {
27
			$this->attributes['url_tag'] = $params['v'];
28
		} else {
29
			$this->attributes['url_tag'] = $value;
30
		}	
31
    }
32
}
33