Skill::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
1
<?php
2
/**
3
 * Skill
4
 *
5
 * @package LivePersonInc\LiveEngageLaravel\Models
6
 */
7
8
namespace LivePersonInc\LiveEngageLaravel\Models;
9
10
use Illuminate\Database\Eloquent\Model;
11
use LivePersonInc\LiveEngageLaravel\Facades\LiveEngageLaravel as LiveEngage;
12
13
class Skill extends Model
14
{
15
	protected $guarded = [];
16
	
17 1
	public function __construct($skill)
18
	{
19 1
		if (is_int($skill)) {
20 1
			$skill = LiveEngage::getSkill($skill);
0 ignored issues
show
Bug introduced by
The method getSkill() does not exist on LivePersonInc\LiveEngage...cades\LiveEngageLaravel. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
			/** @scrutinizer ignore-call */ 
21
   $skill = LiveEngage::getSkill($skill);
Loading history...
21
		}
22 1
		parent::__construct((array) $skill);
23 1
	}
24
}
25