Completed
Pull Request — master (#2993)
by
unknown
02:20
created

Mobile::json_encode_options()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 1
dl 0
loc 25
rs 9.52
c 0
b 0
f 0
1
<?php
2
3
namespace Encore\Admin\Form\Field;
4
5 View Code Duplication
class Mobile extends Text
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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
        'mask' => '99999999999',
18
    ];
19
20
    public function render()
21
    {
22
        $this->inputmask($this->options);
23
24
        $this->prepend('<i class="fa fa-phone fa-fw"></i>')
25
            ->defaultAttribute('style', 'width: 150px');
26
27
        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 27 which is incompatible with the return type declared by the interface Illuminate\Contracts\Support\Renderable::render of type string.
Loading history...
28
    }
29
}
30