HeadersHaveBeenSentException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A getSolution() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Runner\Http\Exception;
6
7
use Exception;
8
use Yiisoft\FriendlyException\FriendlyExceptionInterface;
9
10
use function headers_sent;
11
12
final class HeadersHaveBeenSentException extends Exception implements FriendlyExceptionInterface
13
{
14 1
    public function getName(): string
15
    {
16 1
        return 'HTTP headers have been sent.';
17
    }
18
19 1
    public function getSolution(): ?string
20
    {
21 1
        headers_sent($filename, $line);
22
23 1
        return "Headers already sent in $filename on line $line\n"
24 1
            . "Emitter can't send headers once the headers block has already been sent.";
25
    }
26
}
27