Completed
Push — master ( cb16b1...c87003 )
by Ricardo
04:25 queued 25s
created

ServicesContainerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createNewServiceMatcher() 0 6 1
A __invoke() 0 7 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Ricardo Fiorani
5
 * Date: 31/08/2015
6
 * Time: 21:07.
7
 */
8
namespace RicardoFiorani\Container\Factory;
9
10
use RicardoFiorani\Container\ServicesContainer;
11
12
class ServicesContainerFactory
13
{
14 60
    public function __invoke()
15
    {
16 60
        $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...
17 60
        $servicesContainer = new ServicesContainer($configFile);
18
19 60
        return $servicesContainer;
20
    }
21
22 60
    public static function createNewServiceMatcher()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
23
    {
24 60
        $factory = new self();
25
26 60
        return $factory();
27
    }
28
}
29