These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the ONGR package. |
||
5 | * |
||
6 | * (c) NFQ Technologies UAB <[email protected]> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace ONGR\FilterManagerBundle\Filter\Widget; |
||
13 | |||
14 | use ONGR\FilterManagerBundle\Filter\FilterInterface; |
||
15 | use ONGR\FilterManagerBundle\Filter\FilterState; |
||
16 | use ONGR\FilterManagerBundle\Filter\Helper\DocumentFieldAwareTrait; |
||
17 | use ONGR\FilterManagerBundle\Filter\Helper\OptionsAwareTrait; |
||
18 | use ONGR\FilterManagerBundle\Filter\Helper\RequestFieldAwareTrait; |
||
19 | use ONGR\FilterManagerBundle\Filter\Relation\RelationAwareTrait; |
||
20 | use Symfony\Component\HttpFoundation\Request; |
||
21 | |||
22 | /** |
||
23 | * This class generalises filters using single field value from request. |
||
24 | */ |
||
25 | abstract class AbstractFilter implements FilterInterface |
||
26 | { |
||
27 | use RelationAwareTrait; |
||
28 | use RequestFieldAwareTrait; |
||
29 | use DocumentFieldAwareTrait; |
||
30 | use OptionsAwareTrait; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | private $tags = []; |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | public function getState(Request $request) |
||
41 | { |
||
42 | $state = new FilterState(); |
||
43 | $value = $request->get($this->getRequestField()); |
||
44 | |||
45 | if (isset($value) && $value !== '') { |
||
46 | $value = is_array($value) ? array_values($value) : $value; |
||
47 | $state->setActive(true); |
||
48 | $state->setValue($value); |
||
49 | $state->setUrlParameters([$this->getRequestField() => $value]); |
||
50 | } |
||
51 | |||
52 | return $state; |
||
53 | } |
||
54 | |||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getTags() |
||
60 | { |
||
61 | return $this->tags; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @param string $tags |
||
66 | */ |
||
67 | public function setTags($tags) |
||
68 | { |
||
69 | $this->tags = $tags; |
||
0 ignored issues
–
show
|
|||
70 | } |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function isRelated() |
||
76 | { |
||
77 | return false; |
||
78 | } |
||
79 | } |
||
80 |
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..