| Conditions | 3 | 
| Paths | 3 | 
| Total Lines | 12 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 5 | 
| CRAP Score | 3.0416 | 
| Changes | 0 | ||
| 1 | <?php | ||
| 33 | 7 | protected function ensureUserBehaviorAttached() | |
| 34 |     { | ||
| 35 | 7 | $this->user = Instance::ensure($this->user, 'yii\web\User'); | |
| 36 | |||
| 37 | 7 |         foreach ($this->user->getBehaviors() as $behavior) { | |
| 38 | 7 |             if ($behavior instanceof Behavior) { | |
| 39 | 7 | return; | |
| 40 | } | ||
| 41 | } | ||
| 42 | |||
| 43 |         throw new InvalidConfigException('An user instance must be attach `\vxm\mfa\Behavior`'); | ||
| 44 | } | ||
| 45 | |||
| 47 |