ModelFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 22
ccs 8
cts 9
cp 0.8889
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 1
1
<?php
2
3
namespace Dazzle\Channel\Model;
4
5
use Dazzle\Channel\Model\Null\NullModel;
6
use Dazzle\Loop\LoopInterface;
7
use Dazzle\Util\Factory\Factory;
8
9
class ModelFactory extends Factory implements ModelFactoryInterface
10
{
11
    /**
12
     * @param string $name
13
     * @param LoopInterface $loop
14
     */
15 2
    public function __construct($name, LoopInterface $loop)
16
    {
17 2
        parent::__construct();
18
19 2
        $factory = $this;
20
        $factory
21 2
            ->bindParam('name', $name)
22 2
            ->bindParam('loop', $loop)
23
        ;
24
        $factory
25 2
            ->define(NullModel::class, function($config = []) {
0 ignored issues
show
Unused Code introduced by
The parameter $config is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
                return new NullModel();
27 2
            })
28
        ;
29 2
    }
30
}
31