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

DocumentRepository::isResponsible()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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