| 1 | <?php declare(strict_types = 1); |
||
| 11 | class Query |
||
| 12 | { |
||
| 13 | const TYPE_FIND = 1; |
||
| 14 | const TYPE_FIND_AND_UPDATE = 2; |
||
| 15 | const TYPE_FIND_AND_REMOVE = 3; |
||
| 16 | const TYPE_INSERT = 4; |
||
| 17 | const TYPE_UPDATE = 5; |
||
| 18 | const TYPE_REMOVE = 6; |
||
| 19 | const TYPE_GROUP = 7; |
||
| 20 | const TYPE_MAP_REDUCE = 8; |
||
| 21 | const TYPE_DISTINCT = 9; |
||
| 22 | const TYPE_GEO_NEAR = 10; |
||
| 23 | const TYPE_COUNT = 11; |
||
| 24 | |||
| 25 | /** @var Collection */ |
||
| 26 | private $collection; |
||
| 27 | /** @var array */ |
||
| 28 | private $filters; |
||
| 29 | /** @var array */ |
||
| 30 | private $options; |
||
| 31 | /** @var int */ |
||
| 32 | private $type; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Query constructor. |
||
| 36 | * |
||
| 37 | * @param Collection $collection |
||
| 38 | * @param int $type |
||
| 39 | * @param array $filters |
||
| 40 | * @param array $options |
||
| 41 | */ |
||
| 42 | public function __construct(Collection $collection, int $type=self::TYPE_FIND, array $filters=[], array $options=[]) |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return mixed |
||
| 52 | * |
||
| 53 | * @throws \Exception |
||
| 54 | */ |
||
| 55 | protected function execute() |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return array |
||
| 71 | */ |
||
| 72 | public function getFilters(): array |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return array |
||
| 79 | */ |
||
| 80 | public function getOptions(): array |
||
| 84 | } |
||
| 85 |
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.