Passed
Push — master ( 12a785...934d34 )
by Vincent
03:29
created

Assert::getInvalidArgumentExceptionRegex()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 1
nop 3
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
namespace VGirol\JsonApiAssert;
3
4
use VGirol\JsonApiAssert\Asserts\AssertAttributesObject;
5
use VGirol\JsonApiAssert\Asserts\AssertBase;
6
use VGirol\JsonApiAssert\Asserts\AssertErrorsObject;
7
use VGirol\JsonApiAssert\Asserts\AssertJsonapiObject;
8
use VGirol\JsonApiAssert\Asserts\AssertLinksObject;
9
use VGirol\JsonApiAssert\Asserts\AssertMemberName;
10
use VGirol\JsonApiAssert\Asserts\AssertMetaObject;
11
use VGirol\JsonApiAssert\Asserts\AssertRelationshipsObject;
12
use VGirol\JsonApiAssert\Asserts\AssertResourceLinkage;
13
use VGirol\JsonApiAssert\Asserts\AssertResourceObject;
14
use VGirol\JsonApiAssert\Asserts\AssertStructure;
15
16
class Assert
17
{
18
    use AssertAttributesObject;
19
    use AssertBase;
20
    use AssertErrorsObject;
21
    use AssertJsonapiObject;
22
    use AssertLinksObject;
23
    use AssertMemberName;
24
    use AssertMetaObject;
25
    use AssertRelationshipsObject;
26
    use AssertResourceLinkage;
27
    use AssertResourceObject;
28
    use AssertStructure;
29
30
    public static function getInvalidArgumentExceptionRegex(int $argument, string $type, $value = null)
31
    {
32
        return \sprintf(
33
            '/Argument #%d%sof %s::%s\(\) must be a %s/',
34
            $argument,
35
            is_null($value) ? '.*' : ' \(' . \gettype($value) . '#' . $value . '\)',
36
            '.*',
37
            '.*',
38
            $type
39
        );
40
    }
41
}
42