AbstractParser::parsePath()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Changelog keeper
4
 *
5
 * @link      https://github.com/hiqdev/chkipper
6
 * @package   chkipper
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2016-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\chkipper\lib\parsers;
12
13
use hiqdev\chkipper\lib\Builder;
14
15
/**
16
 * Abstract history parser.
17
 *
18
 * @author Andrii Vasyliev <[email protected]>
19
 */
20
abstract class AbstractParser extends Builder
21
{
22 3
    public function parsePath($path)
23
    {
24 3
        $lines = is_file($path) ? file($path) : [];
25
26 3
        return $this->parseLines($lines);
0 ignored issues
show
Bug introduced by
It seems like $lines can also be of type false; however, parameter $lines of hiqdev\chkipper\lib\pars...actParser::parseLines() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

26
        return $this->parseLines(/** @scrutinizer ignore-type */ $lines);
Loading history...
27
    }
28
29
    abstract public function parseLines(array $lines);
30
}
31