ChkipperConfig::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 8
ccs 0
cts 8
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * HiDev plugin for Chkipper
4
 *
5
 * @link      https://github.com/hiqdev/hidev-chkipper
6
 * @package   hidev-chkipper
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2016-2020, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hidev\chkipper\components;
12
13
/**
14
 * `chkipper.json` file component.
15
 * @author Andrii Vasyliev <[email protected]>
16
 */
17
class ChkipperConfig extends \hidev\components\File
18
{
19
    protected $_file = 'chkipper.json';
20
21
    public function load()
22
    {
23
        parent::load();
24
        $this->mergeItems([
25
            'name'    => $this->getName(),
26
            'authors' => $this->getAuthors(),
27
        ], 'first');
0 ignored issues
show
Unused Code introduced by
The call to ChkipperConfig::mergeItems() has too many arguments starting with 'first'.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
28
    }
29
30
    public function getName()
31
    {
32
        return $this->take('package')->fullName;
33
    }
34
35
    public function getAuthors()
36
    {
37
        return $this->take('package')->authors;
38
    }
39
}
40