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 ( 73195f...eaaffc )
by James
03:05
created

Before::bracesPlacedOnePerLine()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 7
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
/**
4
 * This file is part of WebHelper Parser.
5
 *
6
 * (c) James <[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 WebHelper\Parser\Parser;
13
14
/**
15
 * Methods that can be applied depending of the kind of server before a parsed configuration file turns into an array.
16
 *
17
 * @author James <[email protected]>
18
 */
19
class Before
20
{
21
    /**
22
     * Deletes commented lines and end line comments.
23
     *
24
     * @param string $config a file content
25
     *
26
     * @return string a file content without comments
27
     */
28 11 View Code Duplication
    public static function deleteComments($config = '')
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
    {
30 11
        $config = preg_replace('/^\s*#.*/m', '', $config);
31 11
        $config = preg_replace('/^([^#]+)#.*/m', '$1', $config);
32
33 11
        return $config;
34
    }
35
36
    /**
37
     * Sets starting and endind directives in a line.
38
     *
39
     * For convinience, in nginx configuration context, braces are placed one per line
40
     *
41
     * @param string $config a file content
42
     *
43
     * @return string a file content without comments
44
     */
45 2 View Code Duplication
    public static function bracesPlacedOnePerLine($config = '')
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
46
    {
47 2
        $config = preg_replace('/\{\n?/m', "{\n", $config);
48 2
        $config = preg_replace('/\n?\}/m', "\n}", $config);
49
50 2
        return $config;
51
    }
52
}
53