Passed
Push — master ( 0a87d5...5ba6bb )
by Julito
18:12
created

AccessGroupFixtures   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 5 1
A setContainer() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CoreBundle\DataFixtures;
8
9
use Chamilo\CoreBundle\Repository\GroupRepository;
10
use Doctrine\Bundle\FixturesBundle\Fixture;
11
use Doctrine\Persistence\ObjectManager;
12
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
13
use Symfony\Component\DependencyInjection\ContainerInterface;
14
15
class AccessGroupFixtures extends Fixture implements ContainerAwareInterface
16
{
17
    private ContainerInterface $container;
18
19
    public function setContainer(ContainerInterface $container = null): void
20
    {
21
        $this->container = $container;
22
    }
23
24
    public function load(ObjectManager $manager): void
25
    {
26
        /** @var GroupRepository $repo */
27
        $repo = $this->container->get(GroupRepository::class);
28
        $repo->createDefaultGroups($this);
29
    }
30
}
31