AsyncPersistPageHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 17
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the FOSElasticaBundle package.
5
 *
6
 * (c) FriendsOfSymfony <https://friendsofsymfony.github.com/>
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
namespace FOS\ElasticaBundle\Message\Handler;
13
14
use FOS\ElasticaBundle\Message\AsyncPersistPage;
15
use FOS\ElasticaBundle\Persister\AsyncPagerPersister;
16
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
17
18
class AsyncPersistPageHandler implements MessageHandlerInterface
19
{
20
    /**
21
     * @var AsyncPagerPersister
22
     */
23
    private $persister;
24
25
    public function __construct(AsyncPagerPersister $persister)
26
    {
27
        $this->persister = $persister;
28
    }
29
30
    public function __invoke(AsyncPersistPage $message): void
31
    {
32
        $this->persister->insertPage($message->getPage(), $message->getOptions());
33
    }
34
}
35