Test Failed
Push — master ( ed7d3a...1e1c10 )
by Dominik
02:15
created

DocumentRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fromPersistence() 0 4 1
A getTable() 0 4 1
A isResponsible() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ApiSkeleton\Repository;
6
7
use Chubbyphp\Model\ModelInterface;
8
use Chubbyphp\ApiSkeleton\Model\Document;
9
10
final class DocumentRepository extends AbstractRepository
11
{
12
    /**
13
     * @param array $row
14
     *
15
     * @return ModelInterface
16
     */
17
    protected function fromPersistence(array $row): ModelInterface
18
    {
19
        return Document::fromPersistence($row);
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    protected function getTable(): string
26
    {
27
        return 'documents';
28
    }
29
30
    /**
31
     * @param string $modelClass
32
     *
33
     * @return bool
34
     */
35
    public function isResponsible(string $modelClass): bool
36
    {
37
        return $modelClass === Document::class;
38
    }
39
}
40