| Total Complexity | 12 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class Password extends AbstractField |
||
|
|
|||
| 13 | { |
||
| 14 | use Orderable; |
||
| 15 | use Nullable; |
||
| 16 | use Tooltip; |
||
| 17 | use Placeholder; |
||
| 18 | |||
| 19 | /** @var string|Closure */ |
||
| 20 | protected $hash = 'bcrypt'; |
||
| 21 | |||
| 22 | 4 | public function hash($hash) |
|
| 23 | { |
||
| 24 | 4 | if (is_object($hash) && is_a($hash, Closure::class)) { |
|
| 25 | 1 | $this->hash = $hash; |
|
| 26 | 1 | return $this; |
|
| 27 | } |
||
| 28 | |||
| 29 | 3 | if (is_string($hash) && function_exists($hash)) { |
|
| 30 | 1 | $this->hash = $hash; |
|
| 31 | 1 | return $this; |
|
| 32 | } |
||
| 33 | |||
| 34 | // dummy |
||
| 35 | 2 | if (is_null($hash)) { |
|
| 36 | $this->hash = function ($value) { |
||
| 37 | 1 | return $value; |
|
| 38 | }; |
||
| 39 | 1 | return $this; |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | throw new \RuntimeException('Hash for Password field must be valid function name or Closure'); |
|
| 43 | } |
||
| 44 | |||
| 45 | 4 | public function value(Request $request) |
|
| 46 | { |
||
| 47 | 4 | $hash = $this->hash; |
|
| 48 | |||
| 49 | 4 | return $hash(parent::value($request)); |
|
| 50 | } |
||
| 51 | |||
| 52 | 2 | public function shouldSkip(Request $request) |
|
| 53 | { |
||
| 54 | 2 | return !$request->get($this->name()); |
|
| 55 | } |
||
| 56 | |||
| 57 | 1 | public function getListView($model) |
|
| 58 | { |
||
| 59 | 1 | return view('jarboe::crud.fields.password.list', [ |
|
| 60 | 1 | 'model' => $model, |
|
| 61 | 1 | 'field' => $this, |
|
| 62 | ]); |
||
| 63 | } |
||
| 64 | |||
| 65 | 1 | public function getEditFormView($model) |
|
| 66 | { |
||
| 67 | 1 | $template = $this->isReadonly() ? 'readonly' : 'edit'; |
|
| 68 | |||
| 69 | 1 | return view('jarboe::crud.fields.password.'. $template, [ |
|
| 70 | 1 | 'model' => $model, |
|
| 71 | 1 | 'field' => $this, |
|
| 72 | ]); |
||
| 73 | } |
||
| 74 | |||
| 75 | 1 | public function getCreateFormView() |
|
| 79 | ]); |
||
| 80 | } |
||
| 81 | } |
||
| 82 |
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