DashboardService::countCities()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Service\Admin;
6
7
use App\Entity\Category;
8
use App\Entity\City;
9
use App\Entity\DealType;
10
use App\Entity\Page;
11
use App\Entity\Property;
12
use App\Entity\User;
13
use App\Service\Cache\GetCache;
14
15
final class DashboardService
16
{
17
    use GetCache;
18
19
    public function countProperties(): int
20
    {
21
        return $this->getCount('properties_count', Property::class);
22
    }
23
24
    public function countCities(): int
25
    {
26
        return $this->getCount('cities_count', City::class);
27
    }
28
29
    public function countDealTypes(): int
30
    {
31
        return $this->getCount('deal_types_count', DealType::class);
32
    }
33
34
    public function countCategories(): int
35
    {
36
        return $this->getCount('categories_count', Category::class);
37
    }
38
39
    public function countPages(): int
40
    {
41
        return $this->getCount('pages_count', Page::class);
42
    }
43
44
    public function countUsers(): int
45
    {
46
        return $this->getCount('users_count', User::class);
47
    }
48
}
49