Test Failed
Push — master ( e387ef...0464de )
by Lexey
03:14
created

Env   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A dump() 0 4 1
A parse() 0 4 1
1
<?php
2
3
namespace LF\EnvDiff;
4
5
use InvalidArgumentException;
6
use LF\EnvDiff\Env\Dumper;
7
use LF\EnvDiff\Env\Parser;
8
9
class Env
10
{
11
    /**
12
     * @param array $envArray
13
     *
14
     * @return string
15
     */
16
    public static function dump(array $envArray)
17
    {
18
        return (new Dumper())->dump($envArray);
19
    }
20
21
    /**
22
     * @param array $path
23
     *
24
     * @return array
25
     *
26
     * @throws InvalidArgumentException
27
     */
28
    public static function parse($path)
29
    {
30
        return (new Parser())->parse($path);
0 ignored issues
show
Documentation introduced by
$path is of type array, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
31
    }
32
}
33