Passed
Pull Request — task/3376-TYPO3_12_compatibili... (#3452)
by Rafael
73:20 queued 28:15
created

AfterIndexItemsEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 3
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 items ends
24
 *
25
 * @author Lars Tode <[email protected]>
26
 */
27
final class AfterIndexItemsEvent
28
{
29
    /**
30
     * @var array<Item>
31
     */
32
    private array $items;
33
34
    /**
35
     * @var IndexQueueWorkerTask|null
36
     */
37
    private ?IndexQueueWorkerTask $task;
38
39
    private string $runId;
40
41
    /**
42
     * @param array $items
43
     * @param IndexQueueWorkerTask|null $task
44
     * @param string $runId
45
     */
46
    public function __construct(array $items, ?IndexQueueWorkerTask $task, string $runId)
47
    {
48
        $this->items = $items;
49
        $this->task = $task;
50
        $this->runId = $runId;
51
    }
52
53
    /**
54
     * @return array<Item>
55
     */
56
    public function getItems(): array
57
    {
58
        return $this->items;
59
    }
60
61
    /**
62
     * @param array<Item> $items
63
     */
64
    public function setItems(array $items): void
65
    {
66
        $this->items = $items;
67
    }
68
69
    /**
70
     * @return IndexQueueWorkerTask|null
71
     */
72
    public function getTask(): ?IndexQueueWorkerTask
73
    {
74
        return $this->task;
75
    }
76
77
    /**
78
     * @return string
79
     */
80
    public function getRunId(): string
81
    {
82
        return $this->runId;
83
    }
84
}
85