Passed
Push — master ( 185506...7a5f9e )
by Artem
02:29
created

config()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
if (!function_exists('container')) {
4
    function container()
5
    {
6
        return \Illuminate\Container\Container::getInstance();
7
    }
8
}
9
10
if (!  function_exists('configuration')) {
11
    function configuration(string $key)
12
    {
13
        return container(\PrettyBx\Support\Contracts\ConfigurationContract::class)->get($key);
0 ignored issues
show
Unused Code introduced by
The call to container() has too many arguments starting with PrettyBx\Support\Contrac...gurationContract::class. ( Ignorable by Annotation )

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

13
        return /** @scrutinizer ignore-call */ container(\PrettyBx\Support\Contracts\ConfigurationContract::class)->get($key);

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. Please note the @ignore annotation hint above.

Loading history...
14
    }
15
}
16