Failed Conditions
Pull Request — release-11.2.x (#3154)
by Markus
43:20
created

RecordGarbageCheckEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A frontendGroupsRemoved() 0 3 1
1
<?php declare(strict_types = 1);
2
namespace ApacheSolrForTypo3\Solr\Domain\Index\Queue\UpdateHandler\Events;
3
4
/***************************************************************
5
 *  Copyright notice
6
 *
7
 *  (c) 2021 Markus Friedrich <[email protected]>
8
 *  All rights reserved
9
 *
10
 *  This script is part of the TYPO3 project. The TYPO3 project is
11
 *  free software; you can redistribute it and/or modify
12
 *  it under the terms of the GNU General Public License as published by
13
 *  the Free Software Foundation; either version 3 of the License, or
14
 *  (at your option) any later version.
15
 *
16
 *  The GNU General Public License can be found at
17
 *  http://www.gnu.org/copyleft/gpl.html.
18
 *
19
 *  This script is distributed in the hope that it will be useful,
20
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 *  GNU General Public License for more details.
23
 *
24
 *  This copyright notice MUST APPEAR in all copies of the script!
25
 ***************************************************************/
26
27
/**
28
 * Event fired if a record garbage check is triggered
29
 */
30
class RecordGarbageCheckEvent extends AbstractDataUpdateEvent
31
{
32
    /**
33
     * Flag indicating that frontend groups were removed
34
     *
35
     * @var array
36
     */
37
    protected $frontendGroupsRemoved = false;
38
39
    /**
40
     * Constructor
41
     *
42
     * @param int $uid
43
     * @param string $uid
44
     * @param array $fields
45
     * @param bool $frontendGroupsRemoved
46
     */
47
    public function __construct(int $uid, string $table, array $fields = [], bool $frontendGroupsRemoved = false)
48
    {
49
        parent::__construct($uid, $table, $fields);
50
        $this->frontendGroupsRemoved = $frontendGroupsRemoved;
0 ignored issues
show
Documentation Bug introduced by
It seems like $frontendGroupsRemoved of type boolean is incompatible with the declared type array of property $frontendGroupsRemoved.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
51
    }
52
53
    /**
54
     * Indicates the removal of frontend groups
55
     *
56
     * @return bool
57
     */
58
    public function frontendGroupsRemoved(): bool
59
    {
60
        return $this->frontendGroupsRemoved;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->frontendGroupsRemoved returns the type array which is incompatible with the type-hinted return boolean.
Loading history...
61
    }
62
}
63