MOID::getMoid()   A
last analyzed

Complexity

Conditions 4
Paths 3

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 5
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
4
namespace FNDEV\vShpare\Api\VM\Traits;
5
6
7
trait MOID
8
{
9
    public function getMoid($moid=null){
10
        if($moid)
11
            return $moid;
12
        if($this->vmSource && isset($this->vmSource->moid))
13
            return $this->vmSource->moid;
14
        throw new \InvalidArgumentException("provide moid or pass vmSource object");
15
    }
16
}