Completed
Push — 1.2-symfony-4.1 ( b0b494...78eb0c )
by Kamil
19:24
created

CustomBookRepository::findCustomBooks()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AppBundle\Repository;
6
7
use AppBundle\Entity\Book;
8
use Sylius\Component\Resource\Repository\RepositoryInterface;
9
10
final class CustomBookRepository
11
{
12
    /** @var RepositoryInterface */
13
    private $repository;
14
15
    public function __construct(RepositoryInterface $repository)
16
    {
17
        $this->repository = $repository;
18
    }
19
20
    public function findCustomBook(string $author): ?Book
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
21
    {
22
        return $this->repository->findOneBy(['author' => $author]);
23
    }
24
25
    public function findCustomBooks(): iterable
26
    {
27
        return $this->repository->createPaginator();
28
    }
29
}
30