Passed
Push — master ( 4a2070...aab48a )
by Evgenii
01:11
created

ExampleBlock::fields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
use Carbon_Fields\Field;
4
use Helick\Blocks\Block;
5
6
final class ExampleBlock extends Block
7
{
8
    /**
9
     * The block's display name.
10
     *
11
     * @var string
12
     */
13
    protected $name = 'Example';
14
15
    /**
16
     * The block's description.
17
     *
18
     * @var string
19
     */
20
    protected $description = 'This is an example block';
21
22
    /**
23
     * The block's template.
24
     *
25
     * @var string|string[]
26
     */
27
    protected $template = 'partials/blocks/example.php';
28
29
    /**
30
     * Fields to be attached to the block.
31
     *
32
     * @return array
33
     */
34
    public function fields(): array
35
    {
36
        return [
37
            Field::make('text', 'heading', 'Heading'),
38
            Field::make('image', 'image', 'Image'),
39
            Field::make('rich_text', 'content', 'Content'),
40
        ];
41
    }
42
}
43