Failed Conditions
Push — master ( 5e6761...398dce )
by Adrien
04:14 queued 01:57
created

PostRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 9
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAccessibleSubQuery() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcodevTests\Felix\Blog\Repository;
6
7
use Doctrine\ORM\EntityRepository;
8
use Ecodev\Felix\Repository\LimitedAccessSubQuery;
9
10
/**
11
 * A fake repository
12
 */
13
final class PostRepository extends EntityRepository implements LimitedAccessSubQuery
14
{
15
    public function getAccessibleSubQuery(?\Ecodev\Felix\Model\User $user): string
16
    {
17
        if (!$user) {
18
            return 'SELECT id FROM post WHERE is_public = 1';
19
        }
20
21
        return '';
22
    }
23
}
24