MessageManagerMock::findByTypes()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 3
nc 2
nop 3
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\NotificationBundle\Tests\Entity;
15
16
use Sonata\NotificationBundle\Entity\MessageManager;
17
18
/**
19
 * @author Kevin Nedelec <[email protected]>
20
 */
21
class MessageManagerMock extends MessageManager
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
27
    {
28
        $result = [];
29
        while (null !== $limit && $limit > 0) {
30
            $result[$limit] = new Message();
31
            --$limit;
32
        }
33
34
        return $result;
35
    }
36
37
    public function findByTypes(array $types, $state, $batchSize)
38
    {
39
        $result = [];
40
        while (null !== $batchSize && $batchSize > 0) {
41
            $result[$batchSize] = new Message();
42
            --$batchSize;
43
        }
44
45
        return $result;
46
    }
47
48
    public function save($message, $andFlush = true): void
49
    {
50
    }
51
}
52