1 | <?php |
||
31 | class MongoDBRepository extends DocumentRepository implements Repository |
||
32 | { |
||
33 | use RepositoryTrait; |
||
34 | use EventsTrait; |
||
35 | use FiltersTrait; |
||
36 | use PaginatorTrait; |
||
37 | |||
38 | /** |
||
39 | * Class name. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $className; |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function getClassName(): string |
||
56 | |||
57 | /** |
||
58 | * Finds documents by a set of criteria. |
||
59 | * |
||
60 | * @param array $criteria |
||
61 | * @param array $sort |
||
|
|||
62 | * @param int|null $limit |
||
63 | * @param int|null $skip |
||
64 | * |
||
65 | * @return ArrayCollection |
||
66 | * |
||
67 | * @codeCoverageIgnore |
||
68 | */ |
||
69 | public function findBy(array $criteria, array $sort = null, $limit = null, $skip = null) |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | protected function getFilterCollection() |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | protected function getManager(): DocumentManager |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | * |
||
93 | * @param array $criteria |
||
94 | * @param array|null $orderBy |
||
95 | * @param int $itemsPerPage |
||
96 | * |
||
97 | * @return \Zend\Paginator\Paginator |
||
98 | */ |
||
99 | public function findPaginatedBy($criteria, array $orderBy = null, int $itemsPerPage = 10): Paginator |
||
103 | |||
104 | /** |
||
105 | * Paginate MongoDB cursor. |
||
106 | * |
||
107 | * @param Cursor $cursor |
||
108 | * @param int $itemsPerPage |
||
109 | * |
||
110 | * @return Paginator |
||
111 | */ |
||
112 | protected function paginate(Cursor $cursor, int $itemsPerPage = 10): Paginator |
||
116 | |||
117 | /** |
||
118 | * {@inheritdoc} |
||
119 | * |
||
120 | * @param array $criteria |
||
121 | * |
||
122 | * @return int |
||
123 | */ |
||
124 | public function countBy($criteria): int |
||
128 | } |
||
129 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive. In addition it looks for parameters that have the generic type
array
and suggests a stricter type likearray<String>
.Most often this is a case of a parameter that can be null in addition to its declared types.