Passed
Push — master ( 413ea4...a7ed20 )
by Daniel
22:03 queued 16:10
created

LayoutRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 11
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A findDefault() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Silverback API Components Bundle Project
5
 *
6
 * (c) Daniel West <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Silverback\ApiComponentsBundle\Repository\Core;
15
16
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
17
use Doctrine\Persistence\ManagerRegistry;
18
use Silverback\ApiComponentsBundle\Entity\Core\Layout;
19
20
/**
21
 * @author Daniel West <[email protected]>
22
 *
23
 * @method Layout|null find($id, $lockMode = null, $lockVersion = null)
24
 * @method Layout|null findOneBy(array $criteria, array $orderBy = null)
25
 * @method Layout[]    findAll()
26
 * @method Layout[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
27
 */
28
class LayoutRepository extends ServiceEntityRepository
29
{
30 2
    public function __construct(ManagerRegistry $registry)
31
    {
32 2
        parent::__construct($registry, Layout::class);
33 2
    }
34
35 2
    public function findDefault()
36
    {
37 2
        return $this->findOneBy([
38 2
            'default' => true,
39
        ]);
40
    }
41
}
42