Passed
Push — task/3376-TYPO3_12_compatibili... ( b42ab1...4e0f1e )
by Rafael
49:28 queued 04:28
created

AfterIndexItemEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getRunId() 0 3 1
A getTask() 0 3 1
A getItem() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
namespace ApacheSolrForTypo3\Solr\Event\Indexing;
19
20
use ApacheSolrForTypo3\Solr\IndexQueue\Item;
21
use ApacheSolrForTypo3\Solr\Task\IndexQueueWorkerTask;
22
23
/**
24
 * This event is dispatched after the indexing of an item
25
 *
26
 * @author Lars Tode <[email protected]>
27
 */
28
final class AfterIndexItemEvent
29
{
30
    /**
31
     * @var Item
32
     */
33
    private Item $item;
34
35
    /**
36
     * @var IndexQueueWorkerTask|null
37
     */
38
    private ?IndexQueueWorkerTask $task;
39
40
    private string $runId;
41
42
    /**
43
     * @param Item $item
44
     * @param IndexQueueWorkerTask|null $task
45
     * @param string $runId
46
     */
47
    public function __construct(Item $item, ?IndexQueueWorkerTask $task, string $runId)
48
    {
49
        $this->item = $item;
50
        $this->task = $task;
51
        $this->runId = $runId;
52
    }
53
54
    /**
55
     * @return Item
56
     */
57
    public function getItem(): Item
58
    {
59
        return $this->item;
60
    }
61
62
    /**
63
     * @return IndexQueueWorkerTask|null
64
     */
65
    public function getTask(): ?IndexQueueWorkerTask
66
    {
67
        return $this->task;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getRunId(): string
74
    {
75
        return $this->runId;
76
    }
77
}
78