• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

php-bug-catcher / bug-catcher / 11534267277

26 Oct 2024 07:05PM UTC coverage: 87.486% (-3.3%) from 90.754%
11534267277

push

github

tito10047
fixed timezone in tests

804 of 919 relevant lines covered (87.49%)

6.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.68
/src/Controller/Admin/ProjectCrudController.php
1
<?php
2

3
namespace BugCatcher\Controller\Admin;
4

5
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
6
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions;
7
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
8
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
9
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
10
use EasyCorp\Bundle\EasyAdminBundle\Field\BooleanField;
11
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
12
use EasyCorp\Bundle\EasyAdminBundle\Field\CollectionField;
13
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
14
use EasyCorp\Bundle\EasyAdminBundle\Field\UrlField;
15
use BugCatcher\Entity\Project;
16
use BugCatcher\Form\NotifierType;
17
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
18

19
final class ProjectCrudController extends AbstractCrudController
20
{
21

22

23
        public function __construct(
24
                private readonly array $collectors,
25
        ) {}
2✔
26

27
        public static function getEntityFqcn(): string {
28
                return Project::class;
×
29
        }
30

31
        public function configureActions(Actions $actions): Actions {
32
                return parent::configureActions($actions)
2✔
33
                        ->remove(Crud::PAGE_INDEX, Action::DELETE);
2✔
34
        }
35

36

37
        public function configureFields(string $pageName): iterable {
38
                $collectorTypes = $this->collectors;
2✔
39
                if (array_is_list($collectorTypes)) {
2✔
40
                        $collectorTypes = array_combine($collectorTypes, $collectorTypes);
×
41
                }
42
                return [
2✔
43
                        TextField::new('code'),
2✔
44
                        TextField::new('name'),
2✔
45
                        BooleanField::new("enabled"),
2✔
46
                        ChoiceField::new("pingCollector")->setChoices($collectorTypes)->hideOnIndex(),
2✔
47
                        UrlField::new("url"),
2✔
48
                        TextField::new('dbConnection')->hideOnIndex(),
2✔
49
                        AssociationField::new('users')->setColumns(6)->onlyOnForms(),
2✔
50
                ];
2✔
51
        }
52

53
        public static function getSubscribedServices(): array {
54
                $services                               = parent::getSubscribedServices();
×
55
                $services[ParameterBagInterface::class] = ParameterBagInterface::class;
×
56

57
                return $services;
×
58
        }
59

60

61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc