Completed
Push — master ( 068429...c3d8cf )
by Kamil
03:09
created

ModelFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1.0013

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 8
cts 9
cp 0.8889
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 2
crap 1.0013
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