UserRepository::countAll()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the zibios/sharep.
7
 *
8
 * (c) Zbigniew Ślązak
9
 */
10
11
namespace App\Repository\Entity\Account;
12
13
use App\Entity\Access\User;
14
use App\Repository\Traits\SaveEntityTrait;
15
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
16
use Doctrine\Common\Persistence\ManagerRegistry;
17
18
class UserRepository extends ServiceEntityRepository
19
{
20
    use SaveEntityTrait;
21
22 25
    public function __construct(ManagerRegistry $registry)
23
    {
24 25
        parent::__construct($registry, User::class);
25 25
    }
26
27 11
    public function isAny(): bool
28
    {
29 11
        return $this->countAll() > 0;
30
    }
31
32 11
    public function countAll(): int
33
    {
34 11
        return $this->count([]);
35
    }
36
}
37