Test Setup Failed
Push — main ( 7bb2c5...c5b0e8 )
by Daniel
03:55
created

AccessKeyRepository::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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