Skip to content

Commit bbc61c6

Browse files
committed
1 parent 2ee2bdf commit bbc61c6

9 files changed

Lines changed: 40 additions & 46 deletions

File tree

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
"require": {
2121
"php": "^8.4",
2222
"ext-curl": "*",
23-
"cakephp/cakephp": "^4.6",
24-
"cakephp/migrations": "^3.0.0",
25-
"cakephp/plugin-installer": "^1.3",
23+
"cakephp/cakephp": "5.3.*",
24+
"cakephp/migrations": "^5.0",
25+
"cakephp/plugin-installer": "^2.0",
2626
"composer/ca-bundle": "^1.3"
2727
},
2828
"require-dev": {
29-
"cakephp/bake": "^2.1.1",
30-
"cakephp/debug_kit": "^4.1.2",
29+
"cakephp/bake": "^3.6",
30+
"cakephp/debug_kit": "^5.2",
3131
"php-mock/php-mock-phpunit": "^2.6",
3232
"phpmyadmin/coding-standard": "^3",
3333
"phpstan/phpstan": "^2",
34-
"phpunit/phpunit": "^9",
34+
"phpunit/phpunit": "^13.0",
3535
"psy/psysh": "@stable"
3636
},
3737
"autoload": {

src/Controller/AppController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ public function beforeFilter(EventInterface $event)
156156

157157
$notif_count = TableRegistry::getTableLocator()->get('Notifications')->find(
158158
'all',
159-
[
160-
'conditions' => ['developer_id' => (int) isset($current_developer) ? $current_developer['id'] : null],
161-
]
159+
conditions: ['developer_id' => (int) isset($current_developer) ? $current_developer['id'] : null]
162160
)->count();
163161
$this->set('current_developer', $current_developer);
164162
$this->set('developer_signed_in', true);

src/Controller/GithubController.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,9 @@ public function sync_issue_status(): void
509509
// Fetch all linked reports
510510
$reports = $reportsTable->find(
511511
'all',
512-
[
513-
'conditions' => [
514-
'sourceforge_bug_id IS NOT NULL',
515-
'NOT' => ['status' => 'resolved'],
516-
],
512+
conditions: [
513+
'sourceforge_bug_id IS NOT NULL',
514+
'NOT' => ['status' => 'resolved'],
517515
]
518516
);
519517

src/Controller/NotificationsController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,8 @@ public function data_tables(): Response
105105
$rows = $this->Notifications->find('all', $pagedParams);
106106
$totalFiltered = $this->Notifications->find(
107107
'all',
108-
[
109-
'conditions' => [
110-
'developer_id' => $current_developer['id'],
111-
],
108+
conditions: [
109+
'developer_id' => $current_developer['id'],
112110
]
113111
)->count();
114112

src/Controller/PagesController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ class PagesController extends AppController
4040
{
4141
/**
4242
* Controller name.
43-
*
44-
* @var string
4543
*/
46-
public $name = 'Pages';
44+
public string $name = 'Pages';
4745

4846
/**
4947
* Displays a view.

src/Controller/ReportsController.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ public function index(): void
8787
);
8888
$this->set(
8989
'distinct_error_names',
90-
$this->findArrayList($this->Reports->find('all', [
91-
'fields' => ['error_name'],
92-
'conditions' => ['error_name !=' => ''],
93-
])->distinct(['error_name']), 'error_name')
90+
$this->findArrayList($this->Reports->find(
91+
'all',
92+
fields: ['error_name'],
93+
conditions: ['error_name !=' => '']
94+
)->distinct(['error_name']), 'error_name')
9495
);
9596
$this->set('statuses', $this->Reports->status);
9697
$this->autoRender = true;

src/Model/Table/ReportsTable.php

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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 . ''];

src/Shell/CleanOldNotifsShell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function execute(Arguments $args, ConsoleIo $io)
6767
$XTime = time() - 60 * 24 * 3600;
6868
$conditions = ['Notifications.created <' => date('Y-m-d H:i:s', $XTime)];
6969

70-
if ($this->Notifications->find('all', ['conditions' => $conditions])->count() === 0) {
70+
if ($this->Notifications->find('all', conditions: $conditions)->count() === 0) {
7171
// Check if there are any notifications to delete
7272
Log::write(
7373
'info',

src/View/Helper/ReportsHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class ReportsHelper extends AppHelper
1515
{
1616
/** @var string */
17-
public $helpers = ['Incidents'];
17+
public array $helpers = ['Incidents'];
1818

1919
/**
2020
* @param array[] $entries Entries

0 commit comments

Comments
 (0)