Passed
Push — dependabot/composer/symfony/st... ( e356bf...9fdcfc )
by
unknown
11:08 queued 03:51
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
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\UsersBundle\Controller;
15
16
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
17
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
18
use Zikula\UsersBundle\Entity\User;
19
20
class UserCrudController extends AbstractCrudController
21
{
22
    public static function getEntityFqcn(): string
23
    {
24
        return User::class;
25
    }
26
27
    public function configureCrud(Crud $crud): Crud
28
    {
29
        return $crud
30
            ->setEntityLabelInSingular('User')
31
            ->setEntityLabelInPlural('Users')
32
            ->setPageTitle('index', '%entity_label_plural% list')
33
            ->setPageTitle('detail', fn (User $user) => $user)
34
            ->setPageTitle('edit', fn (User $user) => sprintf('Editing <strong>%s</strong>', $user))
35
//            ->setDateFormat('...')
36
            // ...
37
        ;
38
    }
39
40
    /*
41
    public function configureFields(string $pageName): iterable
42
    {
43
        return [
44
            IdField::new('id'),
45
            TextField::new('title'),
46
            TextEditorField::new('description'),
47
        ];
48
    }
49
    */
50
}
51