Block   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 14
c 2
b 0
f 0
dl 0
loc 76
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fields() 0 3 1
A with() 0 3 1
1
<?php
2
3
namespace Helick\Blocks;
4
5
use Helick\Contracts\Bootable;
6
7
abstract class Block implements Bootable
8
{
9
    use Traits\NestedDeclaration,
10
        Traits\Bootable,
11
        Traits\Composable,
12
        Traits\Renderable;
13
14
    /**
15
     * The block's display name.
16
     *
17
     * @var string
18
     */
19
    protected $name = '';
20
21
    /**
22
     * The block's description.
23
     *
24
     * @var string
25
     */
26
    protected $description = '';
27
28
    /**
29
     * The block's icon.
30
     *
31
     * @var string
32
     */
33
    protected $icon = 'star-empty';
34
35
    /**
36
     * The block's category.
37
     *
38
     * @var string
39
     */
40
    protected $category = '';
41
42
    /**
43
     * The block's keywords.
44
     *
45
     * @var string[]
46
     */
47
    protected $keywords = [];
48
49
    /**
50
     * The block's preview mode.
51
     *
52
     * @var bool
53
     */
54
    protected $preview = true;
55
56
    /**
57
     * The block's template(s).
58
     *
59
     * @var string|string[]
60
     */
61
    protected $template = '';
62
63
    /**
64
     * Fields to be attached to the block.
65
     *
66
     * @return array
67
     */
68
    public function fields(): array
69
    {
70
        return [];
71
    }
72
73
    /**
74
     * Data to be passed to the rendered block.
75
     *
76
     * @param array $fields
77
     *
78
     * @return array
79
     */
80
    public function with(array $fields): array
0 ignored issues
show
Unused Code introduced by
The parameter $fields is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

80
    public function with(/** @scrutinizer ignore-unused */ array $fields): array

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
81
    {
82
        return [];
83
    }
84
}
85