Iframe   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 39
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A size() 0 3 1
1
<?php
2
3
namespace Giuga\LaravelNovaFieldIframe;
4
5
use Laravel\Nova\Fields\Field;
0 ignored issues
show
Bug introduced by
The type Laravel\Nova\Fields\Field was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
class Iframe extends Field
8
{
9
    /**
10
     * The field's component.
11
     *
12
     * @var string
13
     */
14
    public $component = 'iframe';
15
16
    /**
17
     * Indicates if the element should be shown on the index view.
18
     *
19
     * @var bool
20
     */
21
    public $showOnIndex = false;
22
    /**
23
     * Indicates if the element should be shown on the creation view.
24
     *
25
     * @var bool
26
     */
27
    public $showOnCreation = false;
28
    /**
29
     * Indicates if the element should be shown on the update view.
30
     *
31
     * @var bool
32
     */
33
    public $showOnUpdate = false;
34
35
    /**
36
     * Set the size of the iframe.
37
     *
38
     * @param string $width
39
     * @param string $height
40
     *
41
     * @return $this
42
     */
43
    public function size(string $width = '100%', string $height = '600px'): self
44
    {
45
        return $this->withMeta(['width' => $width, 'height' => $height]);
46
    }
47
}
48