Completed
Push — master ( ebc724...0d59f6 )
by wen
02:37
created

ElementFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
1
<?php
2
3
4
namespace Sco\Admin\Form;
5
6
use Illuminate\Foundation\Application;
7
use Sco\Admin\Contracts\Form\Elements\ElementFactoryInterface;
8
use Sco\Admin\Form\Elements\Select;
9
use Sco\Admin\Form\Elements\Text;
10
use Sco\Admin\Traits\AliasBinder;
11
12
/**
13
 * Class ElementFactory
14
 * @method Text text($name, $title)
15
 * @method Select select($name, $title)
16
 */
17
class ElementFactory implements ElementFactoryInterface
18
{
19
    use AliasBinder;
20
21
    protected $app;
22
23
    public function __construct(Application $app)
24
    {
25
        $this->app = $app;
26
27
        $this->registerAliases([
28
            'text'   => Text::class,
29
            'select' => Select::class,
30
        ]);
31
    }
32
}
33