GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#688)
by
unknown
18:52
created

Text::save()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 10

Duplication

Lines 18
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 18
loc 18
ccs 0
cts 13
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 1
crap 2
1
<?php
2
3
namespace SleepingOwl\Admin\Display\Column\Editable;
4
5
use Illuminate\Http\Request;
6
use SleepingOwl\Admin\Form\FormDefault;
7
use SleepingOwl\Admin\Contracts\Display\ColumnEditableInterface;
8
9 View Code Duplication
class Text extends EditableColumn implements ColumnEditableInterface
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...
10
{
11
    /**
12
     * @var string
13
     */
14
    protected $view = 'column.editable.text';
15
16
    /**
17
     * Text constructor.
18
     *
19
     * @param             $name
20
     * @param             $label
21
     */
22
    public function __construct($name, $label = null)
23
    {
24
        parent::__construct($name, $label);
25
    }
26
27
    /**
28
     * @param Request $request
29
     *
30
     * @return void
31
     */
32
    public function save(Request $request)
33
    {
34
        $form = new FormDefault([
35
            new \SleepingOwl\Admin\Form\Element\Text(
36
                $this->getName()
37
            ),
38
        ]);
39
40
        $model = $this->getModel();
41
42
        $request->offsetSet($this->getName(), $request->input('value', null));
43
44
        $form->setModelClass(get_class($model));
45
        $form->initialize();
46
        $form->setId($model->getKey());
47
48
        $form->saveForm($request);
49
    }
50
}
51