TestPrinter::printDefect()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 12
rs 10
cc 2
nc 2
nop 2
1
<?php
2
3
namespace FigTree\Config\Tests;
4
5
use PHPUnit\TextUI\DefaultResultPrinter;
6
use PHPUnit\Framework\TestFailure;
7
use PHPUnit\Exception;
8
9
class TestPrinter extends DefaultResultPrinter
10
{
11
	protected function printDefect(TestFailure $defect, int $count): void
12
	{
13
		$this->printDefectHeader($defect, $count);
14
15
		$exception = $defect->thrownException();
16
17
		if (!($exception instanceof Exception)) {
18
			$this->write(sprintf('%s:%u', $exception->getFile(), $exception->getLine()));
19
			$this->write(PHP_EOL);
20
		}
21
22
		$this->printDefectTrace($defect);
23
	}
24
}
25