CommandParserTrait::checkUser()   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 1
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 1
b 0
f 1
cc 2
eloc 3
nc 2
nop 1
crap 2
1
<?php
2
3
namespace MessageApp\Parser;
4
5
use MessageApp\Parser\Exception\MessageParserException;
6
7
trait CommandParserTrait
8
{
9
    /**
10
     * @param ParsingUser $user
11
     *
12
     * @throws MessageParserException
13
     */
14 6
    protected function checkUser(ParsingUser $user)
15
    {
16 6
        if (! $user->isDefined()) {
17 3
            throw MessageParserException::invalidUser($user);
18
        }
19 3
    }
20
}
21