Skip to content

Commit f11005c

Browse files
committed
fix: corrected PHPUnit 12.5 notices
1 parent 4c00d7c commit f11005c

File tree

70 files changed

+179
-168
lines changed

Some content is hidden

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

70 files changed

+179
-168
lines changed

phpmyfaq/admin/assets/src/user/users.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ export const handleUsers = async (): Promise<void> => {
223223
location.reload();
224224
}, 1500);
225225
} else {
226-
pushErrorNotification(response.error as string);
226+
const errorMessage = Array.isArray(response) ? response.join('\n') : (response as unknown as string);
227+
pushErrorNotification(errorMessage);
227228
}
228229
} catch (error) {
229230
console.error('Error adding user: ', error);
@@ -261,7 +262,10 @@ export const handleUsers = async (): Promise<void> => {
261262
modal.hide();
262263
}
263264
if (response.error) {
264-
pushErrorNotification(response.error);
265+
const errorMessage: string = Array.isArray(response.error)
266+
? response.error.join('\n')
267+
: (response.error as string);
268+
pushErrorNotification(errorMessage);
265269
}
266270
});
267271
}
@@ -295,7 +299,8 @@ export const handleUsers = async (): Promise<void> => {
295299
await clearUserForm();
296300
}
297301
if (response.error) {
298-
pushErrorNotification(response.error);
302+
const errorMessage = Array.isArray(response.error) ? response.error.join('\n') : (response.error as string);
303+
pushErrorNotification(errorMessage);
299304
}
300305
}
301306
});
@@ -323,7 +328,8 @@ export const handleUsers = async (): Promise<void> => {
323328
pushNotification(response.success);
324329
}
325330
if (response.error) {
326-
pushErrorNotification(response.error);
331+
const errorMessage = Array.isArray(response.error) ? response.error.join('\n') : (response.error as string);
332+
pushErrorNotification(errorMessage);
327333
}
328334
await updateUser(userId);
329335
});
@@ -350,7 +356,8 @@ export const handleUsers = async (): Promise<void> => {
350356
pushNotification(response.success);
351357
}
352358
if (response.error) {
353-
pushErrorNotification(response.error);
359+
const errorMessage = Array.isArray(response.error) ? response.error.join('\n') : (response.error as string);
360+
pushErrorNotification(errorMessage);
354361
}
355362
await updateUser(userId);
356363
});

phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/AttachmentController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* The Admin Attachment Controller
75
*
@@ -17,6 +15,8 @@
1715
* @since 2023-10-26
1816
*/
1917

18+
declare(strict_types=1);
19+
2020
namespace phpMyFAQ\Controller\Administration\Api;
2121

2222
use phpMyFAQ\Attachment\AttachmentException;

phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/CategoryController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* The Admin Category Controller
75
*
@@ -17,6 +15,8 @@
1715
* @since 2023-10-27
1816
*/
1917

18+
declare(strict_types=1);
19+
2020
namespace phpMyFAQ\Controller\Administration\Api;
2121

2222
use phpMyFAQ\Category;

phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/CommentController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* The Admin Comment Controller
75
*
@@ -17,6 +15,8 @@
1715
* @since 2023-10-25
1816
*/
1917

18+
declare(strict_types=1);
19+
2020
namespace phpMyFAQ\Controller\Administration\Api;
2121

2222
use phpMyFAQ\Controller\AbstractController;

phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/ConfigurationController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* The Admin Configuration Controller
75
*
@@ -17,6 +15,8 @@
1715
* @since 2023-10-26
1816
*/
1917

18+
declare(strict_types=1);
19+
2020
namespace phpMyFAQ\Controller\Administration\Api;
2121

2222
use phpMyFAQ\Controller\AbstractController;

phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/DashboardController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* The Admin Dashboard Controller
75
*
@@ -17,6 +15,8 @@
1715
* @since 2023-10-15
1816
*/
1917

18+
declare(strict_types=1);
19+
2020
namespace phpMyFAQ\Controller\Administration\Api;
2121

2222
use Exception;

phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/ElasticsearchController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* The Admin Elasticsearch Controller
75
*
@@ -17,6 +15,8 @@
1715
* @since 2023-10-26
1816
*/
1917

18+
declare(strict_types=1);
19+
2020
namespace phpMyFAQ\Controller\Administration\Api;
2121

2222
use Elastic\Elasticsearch\Exception\ClientResponseException;

phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/ExportController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* The File Export Controller
75
*
@@ -17,6 +15,8 @@
1715
* @since 2023-12-23
1816
*/
1917

18+
declare(strict_types=1);
19+
2020
namespace phpMyFAQ\Controller\Administration\Api;
2121

2222
use JsonException;

phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/FormController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* The Admin Form Controller
75
* This Source Code Form is subject to the terms of the Mozilla Public License,
@@ -17,6 +15,8 @@
1715
* @since 2024-03-09
1816
*/
1917

18+
declare(strict_types=1);
19+
2020
namespace phpMyFAQ\Controller\Administration\Api;
2121

2222
use phpMyFAQ\Controller\AbstractController;

phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/GlossaryController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* The Admin Glossary Controller
75
*
@@ -17,6 +15,8 @@
1715
* @since 2024-01-27
1816
*/
1917

18+
declare(strict_types=1);
19+
2020
namespace phpMyFAQ\Controller\Administration\Api;
2121

2222
use phpMyFAQ\Controller\AbstractController;

0 commit comments

Comments
 (0)