| Total Complexity | 9 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ColorPicker extends AbstractField |
||
|
|
|||
| 10 | { |
||
| 11 | use Orderable; |
||
| 12 | use Placeholder; |
||
| 13 | |||
| 14 | const HEX = 'hex'; |
||
| 15 | const RGBA = 'rgba'; |
||
| 16 | |||
| 17 | protected $type = self::HEX; |
||
| 18 | |||
| 19 | 1 | public function value(Request $request) |
|
| 20 | { |
||
| 21 | 1 | return (string) parent::value($request); |
|
| 22 | } |
||
| 23 | |||
| 24 | 2 | public function type($type) |
|
| 25 | { |
||
| 26 | 2 | $type = strtolower($type); |
|
| 27 | switch ($type) { |
||
| 28 | 2 | case self::HEX: |
|
| 29 | 2 | case self::RGBA: |
|
| 30 | 1 | $this->type = $type; |
|
| 31 | 1 | break; |
|
| 32 | default: |
||
| 33 | 1 | $this->type = self::HEX; |
|
| 34 | } |
||
| 35 | |||
| 36 | 2 | return $this; |
|
| 37 | } |
||
| 38 | |||
| 39 | 3 | public function getType() |
|
| 40 | { |
||
| 41 | 3 | return $this->type; |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | public function getListView($model) |
|
| 45 | { |
||
| 46 | 1 | return view('jarboe::crud.fields.color-picker.list', [ |
|
| 47 | 1 | 'model' => $model, |
|
| 48 | 1 | 'field' => $this, |
|
| 49 | ]); |
||
| 50 | } |
||
| 51 | |||
| 52 | 1 | public function getEditFormView($model) |
|
| 53 | { |
||
| 54 | 1 | $template = $this->isReadonly() ? 'readonly' : 'edit'; |
|
| 55 | |||
| 56 | 1 | return view('jarboe::crud.fields.color-picker.'. $template, [ |
|
| 57 | 1 | 'model' => $model, |
|
| 58 | 1 | 'field' => $this, |
|
| 59 | ]); |
||
| 60 | } |
||
| 61 | |||
| 62 | 1 | public function getCreateFormView() |
|
| 66 | ]); |
||
| 67 | } |
||
| 68 | } |
||
| 69 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths