ConstrainArrayTrait::constrainArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
3
namespace CL\PHPUnitExtensions;
4
5
/**
6
 * @author    Ivan Kerin <[email protected]>
7
 * @copyright 2014, Clippings Ltd.
8
 * @license   http://spdx.org/licenses/BSD-3-Clause
9
 */
10
trait ConstrainArrayTrait
11
{
12
    /**
13
     * Asserts that a condition is true.
14
     *
15
     * @param  string  $message
16
     * @throws PHPUnit_Framework_AssertionFailedError
17
     */
18
    public function assertArrayConstrained(array $constraints, array $array, $isStrict = true, $message = '')
19
    {
20
        Assert::assertArrayConstrained($constraints, $array, $isStrict, $message);
21
    }
22
23
    /**
24
     * Returns a Constraint/ConstrainArray matcher object.
25
     *
26
     * @return Constraint/ConstrainArray
0 ignored issues
show
Documentation introduced by
The doc-type Constraint/ConstrainArray could not be parsed: Unknown type name "Constraint/ConstrainArray" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
27
     * @since  Method available since Release 3.3.0
28
     */
29
    public function constrainArray(array $constraints, $isStrict = true)
30
    {
31
        return Assert::constrainArray($constraints, $isStrict);
32
    }
33
}
34