CommandParserTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkUser() 0 6 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