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

Assert::that()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
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