Completed
Push — master ( f9866e...fa91dc )
by Song
02:51
created

src/Form/Field/Decimal.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Encore\Admin\Form\Field;
4
5 View Code Duplication
class Decimal extends Text
6
{
7
    protected static $js = [
8
        '/vendor/laravel-admin/AdminLTE/plugins/input-mask/jquery.inputmask.bundle.min.js',
9
    ];
10
11
    /**
12
     * @see https://github.com/RobinHerbots/Inputmask#options
13
     *
14
     * @var array
15
     */
16
    protected $options = [
17
        'alias'      => 'decimal',
18
        'rightAlign' => true,
19
    ];
20
21
    public function render()
22
    {
23
        $options = json_encode($this->options);
24
25
        $this->script = "$('{$this->getElementClassSelector()}').inputmask($options);";
26
27
        $this->prepend('<i class="fa fa-terminal fa-fw"></i>')
28
            ->defaultAttribute('style', 'width: 130px');
29
30
        return parent::render();
0 ignored issues
show
Bug Compatibility introduced by
The expression parent::render(); of type string|Illuminate\View\V...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 30 which is incompatible with the return type declared by the interface Illuminate\Contracts\Support\Renderable::render of type string.
Loading history...
31
    }
32
}
33