Completed
Pull Request — master (#8)
by Ricardo
01:45
created

ServicesContainerFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php declare(strict_types=1);
2
3
namespace RicardoFiorani\Container\Factory;
4
5
use RicardoFiorani\Container\ServicesContainer;
6
7
class ServicesContainerFactory
8
{
9
    public function __invoke(): ServicesContainer
10
    {
11
        $configFile = require __DIR__.'/../../../config/config.php';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
12
        $servicesContainer = new ServicesContainer($configFile);
13
14
        return $servicesContainer;
15
    }
16
17
    public static function createNewServiceMatcher(): ServicesContainer
18
    {
19
        $factory = new self();
20
21
        return $factory();
22
    }
23
}
24