1 | <?php |
||
16 | class Resetter |
||
17 | { |
||
18 | /** |
||
19 | * @var AliasProcessor |
||
20 | */ |
||
21 | private $aliasProcessor; |
||
22 | |||
23 | /*** |
||
24 | * @var ConfigManager |
||
25 | */ |
||
26 | private $configManager; |
||
27 | |||
28 | /** |
||
29 | * @var EventDispatcherInterface |
||
30 | */ |
||
31 | private $dispatcher; |
||
32 | |||
33 | /** |
||
34 | * @var IndexManager |
||
35 | */ |
||
36 | private $indexManager; |
||
37 | |||
38 | /** |
||
39 | * @var MappingBuilder |
||
40 | */ |
||
41 | private $mappingBuilder; |
||
42 | |||
43 | /** |
||
44 | * @param ConfigManager $configManager |
||
45 | * @param IndexManager $indexManager |
||
46 | * @param AliasProcessor $aliasProcessor |
||
47 | * @param MappingBuilder $mappingBuilder |
||
48 | * @param EventDispatcherInterface $eventDispatcher |
||
49 | */ |
||
50 | 12 | public function __construct( |
|
63 | |||
64 | /** |
||
65 | * Deletes and recreates all indexes. |
||
66 | * |
||
67 | * @param bool $populating |
||
68 | * @param bool $force |
||
69 | */ |
||
70 | 1 | public function resetAllIndexes($populating = false, $force = false) |
|
76 | |||
77 | /** |
||
78 | * Deletes and recreates the named index. If populating, creates a new index |
||
79 | * with a randomised name for an alias to be set after population. |
||
80 | * |
||
81 | * @param string $indexName |
||
82 | * @param bool $populating |
||
83 | * @param bool $force If index exists with same name as alias, remove it |
||
84 | * |
||
85 | * @throws \InvalidArgumentException if no index exists for the given name |
||
86 | */ |
||
87 | 7 | public function resetIndex($indexName, $populating = false, $force = false) |
|
108 | |||
109 | /** |
||
110 | * Deletes and recreates a mapping type for the named index. |
||
111 | * |
||
112 | * @param string $indexName |
||
113 | * @param string $typeName |
||
114 | * |
||
115 | * @throws \InvalidArgumentException if no index or type mapping exists for the given names |
||
116 | * @throws ResponseException |
||
117 | */ |
||
118 | 3 | public function resetIndexType($indexName, $typeName) |
|
143 | |||
144 | /** |
||
145 | * A command run when a population has finished. |
||
146 | * |
||
147 | * @param string $indexName |
||
148 | */ |
||
149 | 2 | public function postPopulate($indexName) |
|
158 | } |
||
159 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.