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