GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

CommonAssertionsTrait::assertArrayOf()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 8
nc 3
nop 2
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Inspector\Foundation\Test;
4
5
use PHPUnit_Framework_ExpectationFailedException;
6
7
/**
8
 * @author Kabir Baidhya
9
 */
10
trait CommonAssertionsTrait
11
{
12
13
    /**
14
     * Asserts to make sure an array is an array of instances of the provided class.
15
     *
16
     * @param string $expectedClass The fully-qualified classname
17
     * @param array $array
18
     * @throws PHPUnit_Framework_ExpectationFailedException
19
     */
20
    protected function assertArrayOf($expectedClass, array $array)
21
    {
22
        foreach ($array as $item) {
23
            $assert = (is_a($item, $expectedClass));
24
            if ($assert === false) {
25
                throw new PHPUnit_Framework_ExpectationFailedException(
26
                    sprintf(
27
                        'Failed asserting that the the given array is an array of instances of \'%s\'.',
28
                        $expectedClass
29
                    )
30
                );
31
            }
32
        }
33
    }
34
}
35