← All changes
|
backend/src/Services/InstallActions/DB/AbstractDatabaseTable.php
+5
-8
0.2
→
1.5
View file →
| @@ -1,19 +1,15 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * @copyright © TMS-Plugins. All rights reserved. | |
| 4 | + * @copyright © Melograno Venture Studio. All rights reserved. | |
| 5 | 5 | * @licence See LICENCE.md for license details. |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace IvyForms\Services\InstallActions\DB; |
| 9 | 9 | |
| 10 | -// phpcs:disable PSR1.Files.SideEffects | |
| 11 | -if (!defined('ABSPATH')) { | |
| 12 | - exit; // Exit if accessed directly | |
| 13 | -} | |
| 14 | - | |
| 15 | 10 | use IvyForms\Common\Exceptions\InvalidArgumentException; |
| 11 | +use IvyForms\Services\Translations\BackendStrings; | |
| 16 | 12 | |
| 17 | 13 | /** |
| 18 | 14 | * Class AbstractDatabaseTable |
| 19 | 15 | * |
| @@ -29,9 +25,11 @@ | ||
| 29 | 25 | */ |
| 30 | 26 | public static function getTableName(): string |
| 31 | 27 | { |
| 32 | 28 | if (!static::TABLE) { |
| 33 | - throw new InvalidArgumentException('Table name is not provided'); | |
| 29 | + throw new InvalidArgumentException( | |
| 30 | + BackendStrings::getExceptionStrings()['table_name_not_provided'] | |
| 31 | + ); | |
| 34 | 32 | } |
| 35 | 33 | |
| 36 | 34 | global $wpdb; |
| 37 | 35 | |
| @@ -43,9 +41,8 @@ | ||
| 43 | 41 | */ |
| 44 | 42 | public static function init(): void |
| 45 | 43 | { |
| 46 | 44 | if (file_exists(ABSPATH . 'wp-admin/includes/upgrade.php')) { |
| 47 | - // @phpstan-ignore-next-line | |
| 48 | 45 | require_once ABSPATH . 'wp-admin/includes/upgrade.php'; |
| 49 | 46 | } |
| 50 | 47 | // @phpstan-ignore staticMethod.notFound |
| 51 | 48 | dbDelta(static::buildTable()); |