@@ -89,11 +89,12 @@ public function initialize(array $config): void
8989 */
9090 public function getIncidents (): Query
9191 {
92- return TableRegistry::getTableLocator ()->get ('Incidents ' )->find ('all ' , [
93- 'limit ' => 50 ,
94- 'conditions ' => $ this ->relatedIncidentsConditions (),
95- 'order ' => 'Incidents.created desc ' ,
96- ]);
92+ return TableRegistry::getTableLocator ()->get ('Incidents ' )->find (
93+ 'all ' ,
94+ limit: 50 ,
95+ conditions: $ this ->relatedIncidentsConditions (),
96+ order: 'Incidents.created desc '
97+ );
9798 }
9899
99100 /**
@@ -103,9 +104,7 @@ public function getIncidents(): Query
103104 */
104105 public function getRelatedReports (): Query
105106 {
106- return $ this ->find ('all ' , [
107- 'conditions ' => $ this ->relatedReportsConditions (),
108- ]);
107+ return $ this ->find ('all ' , conditions: $ this ->relatedReportsConditions ());
109108 }
110109
111110 /**
@@ -116,13 +115,14 @@ public function getRelatedReports(): Query
116115 */
117116 public function getIncidentsWithDescription (): Query
118117 {
119- return TableRegistry::getTableLocator ()->get ('Incidents ' )->find ('all ' , [
120- 'conditions ' => [
118+ return TableRegistry::getTableLocator ()->get ('Incidents ' )->find (
119+ 'all ' ,
120+ conditions: [
121121 'NOT ' => ['Incidents.steps is null ' ],
122122 $ this ->relatedIncidentsConditions (),
123123 ],
124- ' order ' => 'Incidents.steps desc ' ,
125- ] );
124+ order: 'Incidents.steps desc '
125+ );
126126 }
127127
128128 /**
@@ -133,16 +133,17 @@ public function getIncidentsWithDescription(): Query
133133 */
134134 public function getIncidentsWithDifferentStacktrace (): Query
135135 {
136- return TableRegistry::getTableLocator ()->get ('Incidents ' )->find ('all ' , [
137- 'fields ' => [
136+ return TableRegistry::getTableLocator ()->get ('Incidents ' )->find (
137+ 'all ' ,
138+ fields: [
138139 'Incidents.stackhash ' ,
139140 'Incidents.stacktrace ' ,
140141 'Incidents.full_report ' ,
141142 'Incidents.exception_type ' ,
142143 ],
143- ' conditions ' => $ this ->relatedIncidentsConditions (),
144- ' group ' => 'Incidents.stackhash ' ,
145- ] )->distinct (['Incidents.stackhash ' ]);
144+ conditions: $ this ->relatedIncidentsConditions (),
145+ group: 'Incidents.stackhash '
146+ )->distinct (['Incidents.stackhash ' ]);
146147 }
147148
148149 /**
@@ -265,8 +266,8 @@ public function getRelatedByField(
265266 $ groupedCount ->select ([
266267 'count ' => $ groupedCount ->func ()->count ('* ' ),
267268 $ fieldAlias => $ field ,
268- ])->group ($ fieldAlias )->distinct (['' . $ fieldAlias . '' ])
269- ->order ('count ' )->toArray ();
269+ ])->groupBy ($ fieldAlias )->distinct (['' . $ fieldAlias . '' ])
270+ ->orderBy ('count ' )->toArray ();
270271
271272 if ($ count ) {
272273 $ queryDetails ['fields ' ] = ['' . $ fieldName . '' ];
0 commit comments