Skip to content

Commit ef8670e

Browse files
committed
Apply automatic fixes
1 parent fed7512 commit ef8670e

File tree

560 files changed

+7239
-5514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

560 files changed

+7239
-5514
lines changed

lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Doctrine\ODM\MongoDB\Aggregation;
46

57
use Doctrine\ODM\MongoDB\DocumentManager;
68
use Doctrine\ODM\MongoDB\Iterator\CachingIterator;
79
use Doctrine\ODM\MongoDB\Iterator\HydratingIterator;
810
use Doctrine\ODM\MongoDB\Iterator\Iterator;
11+
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
12+
use Doctrine\ODM\MongoDB\Persisters\DocumentPersister;
913
use Doctrine\ODM\MongoDB\Query\Expr as QueryExpr;
1014
use GeoJson\Geometry\Point;
1115
use MongoDB\Collection;
1216
use MongoDB\Driver\Cursor;
17+
use function array_map;
18+
use function array_merge;
19+
use function array_unshift;
20+
use function is_array;
1321

1422
/**
1523
* Fluent interface for building aggregation pipelines.
@@ -26,7 +34,7 @@ class Builder
2634
/**
2735
* The ClassMetadata instance.
2836
*
29-
* @var \Doctrine\ODM\MongoDB\Mapping\ClassMetadata
37+
* @var ClassMetadata
3038
*/
3139
private $class;
3240

@@ -50,7 +58,6 @@ class Builder
5058
/**
5159
* Create a new aggregation builder.
5260
*
53-
* @param DocumentManager $dm
5461
* @param string $documentName
5562
*/
5663
public function __construct(DocumentManager $dm, $documentName)
@@ -127,8 +134,6 @@ public function bucketAuto()
127134
* the pipeline returns an error.
128135
*
129136
* @see http://docs.mongodb.org/manual/reference/operator/aggregation/collStats/
130-
* @since 1.5
131-
*
132137
* @return Stage\CollStats
133138
*/
134139
public function collStats()
@@ -200,7 +205,7 @@ public function facet()
200205
* @see http://docs.mongodb.org/manual/reference/operator/aggregation/geoNear/
201206
*
202207
* @param float|array|Point $x
203-
* @param float $y
208+
* @param float $y
204209
* @return Stage\GeoNear
205210
*/
206211
public function geoNear($x, $y = null)
@@ -221,7 +226,9 @@ public function geoNear($x, $y = null)
221226
public function getPipeline()
222227
{
223228
$pipeline = array_map(
224-
function (Stage $stage) { return $stage->getExpression(); },
229+
function (Stage $stage) {
230+
return $stage->getExpression();
231+
},
225232
$this->stages
226233
);
227234

@@ -240,12 +247,12 @@ function (Stage $stage) { return $stage->getExpression(); },
240247
/**
241248
* Returns a certain stage from the pipeline
242249
*
243-
* @param integer $index
250+
* @param int $index
244251
* @return Stage
245252
*/
246253
public function getStage($index)
247254
{
248-
if ( ! isset($this->stages[$index])) {
255+
if (! isset($this->stages[$index])) {
249256
throw new \OutOfRangeException("Could not find stage with index {$index}.");
250257
}
251258

@@ -311,7 +318,7 @@ public function indexStats()
311318
*
312319
* @see http://docs.mongodb.org/manual/reference/operator/aggregation/limit/
313320
*
314-
* @param integer $limit
321+
* @param int $limit
315322
* @return Stage\Limit
316323
*/
317324
public function limit($limit)
@@ -424,7 +431,7 @@ public function replaceRoot($expression = null)
424431
*
425432
* @see https://docs.mongodb.org/manual/reference/operator/aggregation/sample/
426433
*
427-
* @param integer $size
434+
* @param int $size
428435
* @return Stage\Sample
429436
*/
430437
public function sample($size)
@@ -438,7 +445,7 @@ public function sample($size)
438445
*
439446
* @see http://docs.mongodb.org/manual/reference/operator/aggregation/skip/
440447
*
441-
* @param integer $skip
448+
* @param int $skip
442449
* @return Stage\Skip
443450
*/
444451
public function skip($skip)
@@ -456,7 +463,7 @@ public function skip($skip)
456463
* @see http://docs.mongodb.org/manual/reference/operator/aggregation/sort/
457464
*
458465
* @param array|string $fieldName Field name or array of field/order pairs
459-
* @param integer|string $order Field order (if one field is specified)
466+
* @param int|string $order Field order (if one field is specified)
460467
* @return Stage\Sort
461468
*/
462469
public function sort($fieldName, $order = null)
@@ -497,7 +504,6 @@ public function unwind($fieldName)
497504
}
498505

499506
/**
500-
* @param Stage $stage
501507
* @return Stage
502508
*/
503509
protected function addStage(Stage $stage)
@@ -524,18 +530,13 @@ private function applyFilters(array $query)
524530
}
525531

526532
/**
527-
* @return \Doctrine\ODM\MongoDB\Persisters\DocumentPersister
533+
* @return DocumentPersister
528534
*/
529535
private function getDocumentPersister()
530536
{
531537
return $this->dm->getUnitOfWork()->getDocumentPersister($this->class->name);
532538
}
533539

534-
/**
535-
* @param Cursor $cursor
536-
*
537-
* @return Iterator
538-
*/
539540
private function prepareIterator(Cursor $cursor): Iterator
540541
{
541542
$class = null;

0 commit comments

Comments
 (0)