UserRepository::delete()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Orm\Repository;
6
7
use Doctrine\ORM\EntityRepository;
8
use Uxmp\Core\Orm\Model\User;
9
use Uxmp\Core\Orm\Model\UserInterface;
10
11
/**
12
 * @extends EntityRepository<User>
13
 *
14
 * @method null|UserInterface findOneBy(mixed[] $criteria)
15
 * @method null|UserInterface find(mixed $id)
16
 */
17
final class UserRepository extends EntityRepository implements UserRepositoryInterface
18
{
19 1
    public function prototype(): UserInterface
20
    {
21 1
        return new User();
22
    }
23
24 1
    public function save(UserInterface $user): void
25
    {
26 1
        $this->getEntityManager()->persist($user);
27 1
        $this->getEntityManager()->flush();
28
    }
29
30 1
    public function delete(UserInterface $user): void
31
    {
32 1
        $this->getEntityManager()->remove($user);
33 1
        $this->getEntityManager()->flush();
34
    }
35
}
36