Passed
Push — master ( 039de6...202994 )
by
unknown
07:02
created

Thesaurus   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 17
ccs 0
cts 2
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUsageCount() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Model;
6
7
use Application\Traits\HasSite;
8
use Application\Traits\HasSiteInterface;
9
use Doctrine\ORM\Mapping as ORM;
10
use Ecodev\Felix\Model\Traits\HasName;
11
12
#[ORM\MappedSuperclass]
13
abstract class Thesaurus extends AbstractModel implements HasSiteInterface
14
{
15
    use HasName;
16
    use HasSite;
17
18
    #[ORM\Column(type: 'integer', options: ['default' => 0, 'unsigned' => true])]
19
    private int $usageCount = 0;
20
21
    /**
22
     * The nb of cards that use this thesaurus.
23
     *
24
     * Computed by DB triggers.
25
     */
26
    public function getUsageCount(): int
27
    {
28
        return $this->usageCount;
29
    }
30
}
31