Passed
Push — main ( e933de...5ef56a )
by Daniel
03:35
created

AccessKeyRepository::delete()   A

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 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
ccs 3
cts 3
cp 1
crap 1
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<AccessKey>
14
 *
15
 * @method null|AccessKeyInterface findOneBy(mixed[] $criteria)
16
 */
17
final class AccessKeyRepository extends EntityRepository implements AccessKeyRepositoryInterface
18
{
19 1
    #[Pure]
20
    public function prototype(): AccessKeyInterface
21
    {
22 1
        return new AccessKey();
23
    }
24
25 1
    public function save(AccessKeyInterface $accessKey): void
26
    {
27 1
        $this->getEntityManager()->persist($accessKey);
28 1
        $this->getEntityManager()->flush();
29
    }
30
31 1
    public function delete(AccessKeyInterface $accessKey): void
32
    {
33 1
        $this->getEntityManager()->remove($accessKey);
34 1
        $this->getEntityManager()->flush();
35
    }
36
}
37