Passed
Push — master ( b5ed04...e01758 )
by Baptiste
10:04
created

Assert::notContains()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 7
nc 2
nop 3
1
<?php
2
namespace Behapi\Tools;
3
4
use Webmozart\Assert\Assert as webmozart;
5
6
/**
7
 * Assert
8
 *
9
 * Use while https://github.com/webmozart/assert/pull/58 isn't merged
10
 *
11
 * @method static void nullOrNotRegx($value, $pattern, $message = '')
12
 * @method static void allNotRegex($values, $pattern, $message = '')
13
 */
14
final class Assert extends webmozart
15
{
16
    public static function notRegex($value, $pattern, $message = '')
17
    {
18
        if (!preg_match($pattern, $value)) {
19
            return;
20
        }
21
22
        static::reportInvalidArgument(sprintf(
23
            $message ?: 'Expected a value to not match %s',
24
            static::valueToString($pattern)
25
        ));
26
    }
27
}
28