Passed
Push — main ( 8a8481...e053cf )
by Axel
04:22
created

UserCrudController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntityFqcn() 0 3 1
A configureCrud() 0 8 1
1
<?php
2
3
namespace Zikula\UsersBundle\Controller;
4
5
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
6
use Zikula\UsersBundle\Entity\User;
7
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
8
9
class UserCrudController extends AbstractCrudController
10
{
11
    public static function getEntityFqcn(): string
12
    {
13
        return User::class;
14
    }
15
16
    public function configureCrud(Crud $crud): Crud
17
    {
18
        return $crud
19
            ->setEntityLabelInSingular('User')
20
            ->setEntityLabelInPlural('Users')
21
            ->setPageTitle('index', '%entity_label_plural% list')
22
            ->setPageTitle('detail', fn (User $user) => $user)
23
            ->setPageTitle('edit', fn (User $user) => sprintf('Editing <strong>%s</strong>', $user))
24
//            ->setDateFormat('...')
25
            // ...
26
        ;
27
    }
28
29
    /*
30
    public function configureFields(string $pageName): iterable
31
    {
32
        return [
33
            IdField::new('id'),
34
            TextField::new('title'),
35
            TextEditorField::new('description'),
36
        ];
37
    }
38
    */
39
}
40