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

AfterFacetParsedEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

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

4 Methods

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