1 | <?php |
||
33 | class Builder extends BaseBuilder |
||
34 | { |
||
35 | /** |
||
36 | * The DocumentManager instance for this query |
||
37 | * |
||
38 | * @var DocumentManager |
||
39 | */ |
||
40 | private $dm; |
||
41 | |||
42 | /** |
||
43 | * The ClassMetadata instance. |
||
44 | * |
||
45 | * @var \Doctrine\ODM\MongoDB\Mapping\ClassMetadata |
||
46 | */ |
||
47 | private $class; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | */ |
||
52 | private $hydrationClass; |
||
53 | |||
54 | /** |
||
55 | * Create a new aggregation builder. |
||
56 | * |
||
57 | * @param DocumentManager $dm |
||
58 | * @param string $documentName |
||
59 | */ |
||
60 | 11 | public function __construct(DocumentManager $dm, $documentName) |
|
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 2 | public function execute($options = []) |
|
80 | |||
81 | /** |
||
82 | * @param string $className |
||
83 | * |
||
84 | * @return self |
||
85 | */ |
||
86 | 1 | public function hydrate($className) |
|
92 | |||
93 | /** |
||
94 | * @return QueryExpr |
||
95 | */ |
||
96 | 3 | public function matchExpr() |
|
103 | |||
104 | /** |
||
105 | * @return Expr |
||
106 | */ |
||
107 | 4 | public function expr() |
|
111 | |||
112 | /** |
||
113 | * @return Stage\Match |
||
114 | */ |
||
115 | 2 | public function match() |
|
119 | |||
120 | /** |
||
121 | * @param string $from |
||
122 | * @return Stage\Lookup |
||
123 | */ |
||
124 | public function lookup($from) |
||
128 | |||
129 | /** |
||
130 | * @param string $from |
||
131 | * @return Stage\Out |
||
132 | */ |
||
133 | 4 | public function out($from) |
|
137 | |||
138 | /** |
||
139 | * {@inheritdoc} |
||
140 | */ |
||
141 | 2 | public function sort($fieldName, $order = null) |
|
146 | |||
147 | /** |
||
148 | * {@inheritdoc} |
||
149 | */ |
||
150 | 2 | public function unwind($fieldName) |
|
155 | |||
156 | /** |
||
157 | * Returns the assembled aggregation pipeline |
||
158 | * |
||
159 | * For pipelines where the first stage is a $geoNear stage, it will apply |
||
160 | * the document filters and discriminator queries to the query portion of |
||
161 | * the geoNear operation. For all other pipelines, it prepends a $match stage |
||
162 | * containing the required query. |
||
163 | * |
||
164 | * @return array |
||
165 | */ |
||
166 | 8 | public function getPipeline() |
|
181 | |||
182 | /** |
||
183 | * Applies filters and discriminator queries to the pipeline |
||
184 | * |
||
185 | * @param array $query |
||
186 | * @return array |
||
187 | */ |
||
188 | 8 | private function applyFilters(array $query) |
|
197 | |||
198 | /** |
||
199 | * @param BaseCommandCursor $cursor |
||
200 | * |
||
201 | * @return CommandCursor |
||
202 | */ |
||
203 | 2 | private function prepareCursor(BaseCommandCursor $cursor) |
|
212 | |||
213 | /** |
||
214 | * @return \Doctrine\ODM\MongoDB\Persisters\DocumentPersister |
||
215 | */ |
||
216 | 2 | private function getDocumentPersister() |
|
220 | } |
||
221 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.