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

ElementFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 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