Passed
Push — master ( 5c9806...4102cb )
by Alexander
04:15 queued 01:10
created

HeadersHaveBeenSentException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 13
ccs 6
cts 6
cp 1
rs 10
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