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

BeforeIndexItemsEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 11
c 1
b 0
f 0
dl 0
loc 56
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setItems() 0 3 1
A getRunId() 0 3 1
A getTask() 0 3 1
A __construct() 0 5 1
A getItems() 0 3 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 before the indexing of items starts
25
 *
26
 * @author Lars Tode <[email protected]>
27
 */
28
final class BeforeIndexItemsEvent
29
{
30
    /**
31
     * @var array<Item>
32
     */
33
    private array $items;
34
35
    /**
36
     * @var IndexQueueWorkerTask|null
37
     */
38
    private ?IndexQueueWorkerTask $task;
39
40
    private string $runId;
41
42
    /**
43
     * @param array $items
44
     * @param IndexQueueWorkerTask|null $task
45
     * @param string $runId
46
     */
47
    public function __construct(array $items, ?IndexQueueWorkerTask $task, string $runId)
48
    {
49
        $this->items = $items;
50
        $this->task = $task;
51
        $this->runId = $runId;
52
    }
53
54
    /**
55
     * @return array<Item>
56
     */
57
    public function getItems(): array
58
    {
59
        return $this->items;
60
    }
61
62
    /**
63
     * @param array<Item> $items
64
     */
65
    public function setItems(array $items): void
66
    {
67
        $this->items = $items;
68
    }
69
70
    /**
71
     * @return IndexQueueWorkerTask|null
72
     */
73
    public function getTask(): ?IndexQueueWorkerTask
74
    {
75
        return $this->task;
76
    }
77
78
    /**
79
     * @return string
80
     */
81
    public function getRunId(): string
82
    {
83
        return $this->runId;
84
    }
85
}
86