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
Pull Request — master (#68)
by
unknown
02:41
created

FileToMemoryDictLoader::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
ccs 9
cts 9
cp 1
rs 9.4285
cc 3
eloc 6
nc 3
nop 1
crap 3
1
<?php
2
3
/*
4
 * This file is part of the overtrue/pinyin.
5
 *
6
 * (c) 2016 overtrue <[email protected]>
7
 */
8
9
namespace Overtrue\Pinyin;
10
11
use Closure;
12
13
/**
14
 * Dict File loader.
15
 */
16
class FileToMemoryDictLoader extends FileDictLoader implements DictLoaderInterface
17
{
18
    /**
19
     * Segment files
20
     *
21
     * @var array
22
     */
23
    protected $segments = array();
24
25
    /**
26
     * Constructor.
27
     *
28
     * @param string $path
29
     * @param boolean $preload
0 ignored issues
show
Bug introduced by
There is no parameter named $preload. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
30
     */
31 9
    public function __construct($path)
32
    {
33 9
        parent::__construct($path);
34 9
        for ($i = 0; $i < 100; ++$i) {
35 9
            $segment = $this->path . '/' . sprintf($this->segmentName, $i);
36 9
            if (file_exists($segment)) {
37 9
                $this->segments[] = (array) include $segment;
38 9
            }
39 9
        }
40 9
    }
41
42
    /**
43
     * Load dict.
44
     *
45
     * @param Closure $callback
46
     */
47 9
    public function map(Closure $callback)
48
    {
49 9
        foreach ($this->segments as $dictionary) {
50 9
            $callback($dictionary);
51 9
        }
52
53 9
    }
54
}
55