1 | <?php |
||
35 | class Builder extends BaseBuilder |
||
36 | { |
||
37 | /** |
||
38 | * The DocumentManager instance for this query |
||
39 | * |
||
40 | * @var DocumentManager |
||
41 | */ |
||
42 | private $dm; |
||
43 | |||
44 | /** |
||
45 | * The ClassMetadata instance. |
||
46 | * |
||
47 | * @var \Doctrine\ODM\MongoDB\Mapping\ClassMetadata |
||
48 | */ |
||
49 | private $class; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | private $hydrationClass; |
||
55 | |||
56 | /** |
||
57 | * Create a new aggregation builder. |
||
58 | * |
||
59 | * @param DocumentManager $dm |
||
60 | * @param string $documentName |
||
61 | */ |
||
62 | public function __construct(DocumentManager $dm, $documentName) |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function execute($options = array()) |
||
82 | |||
83 | /** |
||
84 | * @param string $className |
||
85 | * |
||
86 | * @return self |
||
87 | */ |
||
88 | public function hydrate($className) |
||
94 | |||
95 | /** |
||
96 | * @return QueryExpr |
||
97 | */ |
||
98 | public function matchExpr() |
||
105 | |||
106 | /** |
||
107 | * @return Expr |
||
108 | */ |
||
109 | public function expr() |
||
113 | |||
114 | /** |
||
115 | * @return Stage\Match |
||
116 | */ |
||
117 | public function match() |
||
121 | |||
122 | /** |
||
123 | * @param string $from |
||
124 | * @return Stage\Lookup |
||
125 | */ |
||
126 | public function lookup($from) |
||
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | public function sort($fieldName, $order = null) |
||
139 | |||
140 | /** |
||
141 | * {@inheritdoc} |
||
142 | */ |
||
143 | public function unwind($fieldName) |
||
148 | |||
149 | /** |
||
150 | * Returns the assembled aggregation pipeline |
||
151 | * |
||
152 | * For pipelines where the first stage is a $geoNear stage, it will apply |
||
153 | * the document filters and discriminator queries to the query portion of |
||
154 | * the geoNear operation. For all other pipelines, it prepends a $match stage |
||
155 | * containing the required query. |
||
156 | * |
||
157 | * @return array |
||
158 | */ |
||
159 | public function getPipeline() |
||
174 | |||
175 | /** |
||
176 | * Applies filters and discriminator queries to the pipeline |
||
177 | * |
||
178 | * @param array $query |
||
179 | * @return array |
||
180 | */ |
||
181 | private function applyFilters(array $query) |
||
190 | |||
191 | /** |
||
192 | * @param BaseCommandCursor $cursor |
||
193 | * |
||
194 | * @return CommandCursor |
||
195 | */ |
||
196 | protected function prepareCursor(BaseCommandCursor $cursor) |
||
205 | |||
206 | /** |
||
207 | * @return \Doctrine\ODM\MongoDB\Persisters\DocumentPersister |
||
208 | */ |
||
209 | private function getDocumentPersister() |
||
213 | } |
||
214 |
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.