QueryExecuteEvent::getResult()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Sulu\Component\DocumentManager\Event;
13
14
use Sulu\Component\DocumentManager\Collection\QueryResultCollection;
15
use Sulu\Component\DocumentManager\Query\Query;
16
17
class QueryExecuteEvent extends AbstractEvent
18
{
19
    use EventOptionsTrait;
20
21
    /**
22
     * @var Query
23
     */
24
    private $query;
25
26
    /**
27
     * @var QueryResultCollection
28
     */
29
    private $result;
30
31
    /**
32
     * @param Query $query
33
     * @param array $options
34
     */
35
    public function __construct(Query $query, array $options = [])
36
    {
37
        $this->query = $query;
38
        $this->options = $options;
0 ignored issues
show
Documentation Bug introduced by
It seems like $options of type array is incompatible with the declared type object<Symfony\Component...solver\OptionsResolver> of property $options.

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...
39
    }
40
41
    /**
42
     * @return Query
43
     */
44
    public function getQuery()
45
    {
46
        return $this->query;
47
    }
48
49
    /**
50
     * @param QueryResultCollection $collection
51
     */
52
    public function setResult(QueryResultCollection $collection)
53
    {
54
        $this->result = $collection;
55
    }
56
57
    /**
58
     * @return mixed
59
     */
60
    public function getResult()
61
    {
62
        return $this->result;
63
    }
64
}
65