ConstrainArrayTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 24
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A assertArrayConstrained() 0 4 1
A constrainArray() 0 4 1
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