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.
Completed
Push — 1.x ( ecb649...535f6c )
by Théo
13:20
created

LoadingLimitException::__construct()   C

Complexity

Conditions 7
Paths 12

Size

Total Lines 28
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 16
CRAP Score 7.9936

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 28
ccs 16
cts 22
cp 0.7272
rs 6.7272
cc 7
eloc 17
nc 12
nop 3
crap 7.9936
1
<?php
2
3
/*
4
 * This file is part of the Hautelook\AliceBundle package.
5
 *
6
 * (c) Baldur Rensch <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Hautelook\AliceBundle\Alice\DataFixtures;
13
14
/**
15
 * Exception thrown when the number of attempts to load a fixture file has reached a certain limit.
16
 *
17
 * @author Théo FIDRY <[email protected]>
18
 */
19
class LoadingLimitException extends \RuntimeException
20
{
21
    /**
22
     * @param int   $limit
23
     * @param array $normalizedFixturesFiles Array where keys are fixtures files path and value is a boolean set to
24
     *                                       true for when the fixture file has been loaded and false otherwise.
25
     * @param array $errorMessages           All encountered errors messages while trying to load fixtures.
26
     */
27 6
    public function __construct($limit, array $normalizedFixturesFiles, array $errorMessages = [])
28
    {
29 6
        $unloadedFiles = [];
30
31 6
        foreach ($normalizedFixturesFiles as $fileRealPath => $hasBeenLoaded) {
32 6
            if (false === $hasBeenLoaded) {
33 6
                $unloadedFiles[] = $fileRealPath;
34 6
            }
35 6
        }
36
37 6
        $messageLines = [];
38 6
        $messageLines[] = sprintf('Loading files limit of %d reached. Could not load the following files:', $limit);
39
40 6
        sort($unloadedFiles);
41 6
        foreach ($unloadedFiles as $unloadedFile) {
42 6
            if (isset($errorMessages[$unloadedFile]) && 0 < count($errorMessages[$unloadedFile])) {
43
                $messageLines[] = sprintf('%s:', $unloadedFile);
44
                $fileErrorMessages = array_unique($errorMessages[$unloadedFile]);
45
                foreach ($fileErrorMessages as $errorMessage) {
46
                    $messageLines[] = sprintf(' - %s', $errorMessage);
47
                }
48
            } else {
49 6
                $messageLines[] = $unloadedFile;
50
            }
51 6
        }
52
53 6
        $this->message = implode(PHP_EOL, $messageLines);
54 6
    }
55
}
56