Passed
Push — master ( 63b2c7...9fa2c5 )
by Baptiste
53s
created

Assert   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 9
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A that() 0 5 1
1
<?php declare(strict_types=1);
2
namespace Behapi\Assert;
3
4
use Assert\Assert as Beberlei;
5
6
/**
7
 * While the PR in links are not merged and released, let's use this assertion
8
 * class to satisfy our needs...
9
 *
10
 * @link https://github.com/beberlei/assert/pull/264
11
 * @link https://github.com/beberlei/assert/pull/265
12
 * @link https://github.com/beberlei/assert/pull/266
13
 * @link https://github.com/beberlei/assert/pull/267
14
 */
15
abstract class Assert extends Beberlei
16
{
17
    protected static $assertionClass = Assertion::class;
18
19
    public static function that($value, $defaultMessage = null, $defaultPropertyPath = null)
20
    {
21
        $assertionChain = new AssertionChain($value, $defaultMessage, $defaultPropertyPath);
22
23
        return $assertionChain->setAssertionClassName(static::$assertionClass);
24
    }
25
}
26