Completed
Push — master ( 0c34b7...ef90f4 )
by Oscar
02:32
created

Articles   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBasePath() 0 4 1
A getScheme() 0 21 1
1
<?php
2
3
namespace Demo\Entities;
4
5
use Folk\Entities\YamlEntity;
6
use FormManager\Builder;
7
8
class Articles extends YamlEntity
9
{
10
    protected function getBasePath()
11
    {
12
        return __DIR__.'/yaml';
13
    }
14
15
    public function getScheme(Builder $builder)
16
    {
17
        return $builder->group([
18
            'title' => $builder->text()
19
                ->label('Title'),
20
21
            'intro' => $builder->html()
22
                ->label('Introduction'),
23
24
            'category' => $builder->select()
25
                ->options([
26
                    'food' => 'Food',
27
                    'sports' => 'Sports',
28
                    'life' => 'Life',
29
                ])
30
                ->label('Category'),
31
32
            'actived' => $builder->checkbox()
33
                ->label('Actived'),
34
        ]);
35
    }
36
}
37