Passed
Pull Request — task/3376-TYPO3_12_compatibili... (#3452)
by
unknown
41:20
created

AfterFacetParsedEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 2
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\Parser;
18
19
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\AbstractFacet;
20
21
/**
22
 * This event is dispatched after an facet is parsed.
23
 *
24
 * @author Lars Tode <[email protected]>
25
 */
26
final class AfterFacetParsedEvent
27
{
28
    /**
29
     * The facet that was processed
30
     *
31
     * @var AbstractFacet
32
     */
33
    private AbstractFacet $facet;
34
35
    /**
36
     * The configuration of the facet
37
     *
38
     * @var array
39
     */
40
    private array $facetConfiguration;
41
42
    /**
43
     * @param AbstractFacet $facet
44
     * @param array $facetConfiguration
45
     */
46
    public function __construct(AbstractFacet $facet, array $facetConfiguration)
47
    {
48
        $this->facet = $facet;
49
        $this->facetConfiguration = $facetConfiguration;
50
    }
51
52
    /**
53
     * Returns the class name of the facet
54
     *
55
     * @return string
56
     */
57
    public function getFacetType(): string
58
    {
59
        return get_class($this->facet);
60
    }
61
62
    /**
63
     * @return AbstractFacet
64
     */
65
    public function getFacet(): AbstractFacet
66
    {
67
        return $this->facet;
68
    }
69
70
    /**
71
     * @return array
72
     */
73
    public function getFacetConfiguration(): array
74
    {
75
        return $this->facetConfiguration;
76
    }
77
}
78