Authorization   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 16
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A passesAuthorization() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Conversation\Concerns;
6
7
use FondBot\Events\MessageReceived;
8
9
trait Authorization
10
{
11
    /**
12
     * Determine if intent passes the authorization check.
13
     *
14
     * @param MessageReceived $message
15
     *
16
     * @return bool
17
     */
18 3
    public function passesAuthorization(MessageReceived $message): bool
19
    {
20 3
        if (method_exists($this, 'authorize')) {
21 1
            return $this->authorize($message);
22
        }
23
24 2
        return true;
25
    }
26
}
27