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 — master ( 5018c7...c440df )
by Miles
03:57
created

AbstractParser   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 41
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A startsWith() 0 4 2
1
<?php
2
3
/**
4
 * This file is part of the m1\env library
5
 *
6
 * (c) m1 <[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
 * @package     m1/env
12
 * @version     0.2.0
13
 * @author      Miles Croxford <[email protected]>
14
 * @copyright   Copyright (c) Miles Croxford <[email protected]>
15
 * @license     http://github.com/m1/env/blob/master/LICENSE.md
16
 * @link        http://github.com/m1/env/blob/master/README.md Documentation
17
 */
18
19
namespace M1\Env\Parser;
20
21
/**
22
 * The abstract parser for Env
23
 *
24
 * @since 0.2.0
25
 */
26
abstract class AbstractParser
27
{
28
    /**
29
     * The .env to parse
30
     *
31
     * @var string $file
32
     */
33
    protected $file;
34
35
    /**
36
     * If to throw ParseException in the .env
37
     *
38
     * @var bool $origin_exception
39
     */
40
    protected $origin_exception;
41
42
    /**
43
     * The abstract parser constructor for Env
44
     *
45
     * @param string $file           The file to use with Env
46
     * @param bool $origin_exception If to throw exceptions in the origin file
47
     */
48 45
    public function __construct($file, $origin_exception)
49
    {
50 45
        $this->file = $file;
51 45
        $this->origin_exception = $origin_exception;
52 45
    }
53
54
    /**
55
     * Returns if value starts with a value
56
     *
57
     * @param string $value The value to search for
0 ignored issues
show
Bug introduced by
There is no parameter named $value. 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...
58
     * @param string $line  The line to test
59
     *
60
     * @return bool Returns if the line starts with value
61
     */
62 42
    protected function startsWith($string, $line)
63
    {
64 42
        return $string === "" || strrpos($line, $string, -strlen($line)) !== false;
65
    }
66
}