Passed
Push — master ( 71cd79...3a5308 )
by Vincent
02:53 queued 20s
created

SetExceptionsTrait::formatAsRegex()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VGirol\JsonApiAssert;
6
7
use PHPUnit\Framework\AssertionFailedError;
8
use VGirol\JsonApiStructure\Testing\SetExceptionsTrait as TestingSetExceptionsTrait;
9
10
/**
11
 * Some helpers for testing
12
 *
13
 * @codeCoverageIgnore
14
 */
15
trait SetExceptionsTrait
16
{
17
    use TestingSetExceptionsTrait {
18
        setFailure as parentSetFailure;
19
    }
20
21
    /**
22
     * Undocumented function
23
     *
24
     * @param string|null $message
25
     * @param int|null    $code
26
     *
27
     * @return void
28
     */
29
    protected function setFailure(?string $message = null, $code = null): void
30
    {
31
        $this->parentSetFailure($message, $code, AssertionFailedError::class);
32
    }
33
}
34