PlayerAuthAction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 10
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Game\Features\Authorization;
6
7
use App\Game\Features\Authorization\Request\LoginRequest;
8
9
final class PlayerAuthAction
10
{
11
    public function __invoke(LoginRequest $request, PlayerLogin $playerLogin): string
12
    {
13
        try {
14
            $playerLogin($request->nickname(), $request->password());
15
16
            return 'Player successfully logged!';
17
        } catch (PlayerLoginException) {
18
            return 'Failed!';
19
        }
20
    }
21
}
22