Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
PlatformAuthException
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getPlatform
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Exceptions;
4
5use App\Enums\PlatformEnum;
6use Exception;
7
8class PlatformAuthException extends Exception
9{
10    public function __construct(
11        private readonly PlatformEnum $platform,
12        string $reason = 'Authentication failed'
13    ) {
14        $message = "Failed to authenticate with {$platform->value}{$reason}";
15
16        parent::__construct($message);
17    }
18
19    public function getPlatform(): PlatformEnum
20    {
21        return $this->platform;
22    }
23}