MockArgumentBuilder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 12
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 14 1
1
<?php
2
3
namespace Feedo\ArgumentBuilder\Tests\Fixtures;
4
5
use Feedo\ArgumentBuilder\AbstractArgumentBuilder;
6
7
/**
8
 * @method $this getArg1()
9
 * @method       setArg1($value, $_ = null)
10
 * @method $this unsetArg1($_ = null)
11
 * @method       getArg2()
12
 * @method $this setArg2($value, $_ = null)
13
 * @method       unsetArg2($_ = null)
14
 * @method $this getSub1()
15
 * @method       setSub1($value, $_ = null)
16
 * @method       unsetSub1($_ = null)
17
 * @method $this getSub2()
18
 * @method       setSub2($value, $_ = null)
19
 * @method       unsetSub2($_ = null)
20
 * @method $this getEnum()
21
 * @method       setEnum($value, $_ = null)
22
 * @method       unsetEnum($_ = null)
23
 */
24
class MockArgumentBuilder extends AbstractArgumentBuilder
25
{
26
    protected function load()
27
    {
28
        $this->fields = array(
29
            'arg1' => self::ARGUMENT_TYPE_MIXED,
30
            'arg2' => self::ARGUMENT_TYPE_MIXED,
31
            'sub1' => SubMockArgumentBuilder::class,
32
            'sub2' => array(
33
                'type' => self::ARGUMENT_TYPE_ARGUMENT_BUILDER,
34
                'class' => SubMockArgumentBuilder::class,
35
            ),
36
            'enum' => array(
37
                'type' => self::ARGUMENT_TYPE_ENUM,
38
                'validator' => function ($value) {
39
                    return in_array($value, array('val1', 'val2'));
40
                },
41
            ),
42
        );
43
    }
44
}
45