phpcs autofixes

This commit is contained in:
Dennis Eichhorn 2023-05-28 12:19:03 +00:00
parent cb76b873e1
commit 94b2a4d0a2
17 changed files with 335 additions and 343 deletions

View File

@ -26,7 +26,7 @@ jobs:
- name: Setup Composer
run: composer install
- name: Autoformat
run: 'vendor/bin/php-cs-fixer fix ./ --rules=''{"array_syntax": {"syntax": "short"}, "blank_line_after_namespace": true, "global_namespace_import": {"import_classes": false, "import_constants": false, "import_functions": false}, "binary_operator_spaces": {"operators": {"=": "align", ".=": "align", "+=": "align", "-=": "align", "*=": "align", "/=": "align", "|=": "align", "&=": "align", "=>": "align", "??=": "align"}}, "cast_spaces": {"space": "single"}, "class_attributes_separation": { "elements": {"const": "one", "method": "one", "property": "one"} }, "combine_consecutive_issets": true, "compact_nullable_typehint": true, "declare_strict_types": true, "declare_equal_normalize": {"space": "none"}, "elseif": true, "encoding": true, "explicit_indirect_variable": true, "explicit_string_variable": true, "function_to_constant": true, "implode_call": true, "increment_style": {"style": "pre"}, "is_null": true, "yoda_style": {"equal": false, "identical": false, "less_and_greater": false}, "line_ending": true, "logical_operators": true, "lowercase_cast": true, "constant_case": {"case": "lower"}, "lowercase_keywords": true, "modernize_types_casting": true, "native_constant_invocation": true, "native_function_casing": true, "native_function_invocation": {"include": ["@all"]}, "new_with_braces": true, "no_extra_blank_lines": {"tokens": ["break", "case", "continue", "curly_brace_block", "extra", "return", "switch", "throw", "use"]}, "no_spaces_after_function_name": true, "no_alias_functions": true, "no_closing_tag": true, "no_empty_comment": true, "no_empty_phpdoc": true, "no_empty_statement": true, "no_homoglyph_names": true, "no_mixed_echo_print": {"use": "echo"}, "no_php4_constructor": true, "no_singleline_whitespace_before_semicolons": true, "no_spaces_inside_parenthesis": true, "no_trailing_whitespace": true, "no_unneeded_final_method": true, "no_unused_imports": true, "no_useless_return": true, "no_whitespace_before_comma_in_array": true, "no_whitespace_in_blank_line": true, "non_printable_character": true, "normalize_index_brace": true, "ordered_imports": {"sort_algorithm": "alpha"}, "ordered_interfaces": {"order": "alpha"}, "php_unit_construct": true, "php_unit_internal_class": true, "php_unit_set_up_tear_down_visibility": true, "phpdoc_indent": true, "phpdoc_align": {"align": "vertical"}, "phpdoc_annotation_without_dot": true, "phpdoc_scalar": true, "phpdoc_return_self_reference": {"replacements": {"this": "self"}}, "phpdoc_trim": true, "phpdoc_trim_consecutive_blank_line_separation": true, "random_api_migration": true, "self_accessor": true, "return_type_declaration": {"space_before": "one"}, "semicolon_after_instruction": true, "set_type_to_cast": true, "short_scalar_cast": true, "single_blank_line_at_eof": true, "single_line_after_imports": true, "standardize_increment": true, "trailing_comma_in_multiline": true, "trim_array_spaces": true, "visibility_required": true, "void_return": true}'' --allow-risky=yes'
run: 'vendor/bin/php-cs-fixer fix ./ --rules=''{"array_syntax": {"syntax": "short"}, "blank_line_after_namespace": true, "global_namespace_import": {"import_classes": false, "import_constants": false, "import_functions": false}, "binary_operator_spaces": {"operators": {"=": "align", ".=": "align", "+=": "align", "-=": "align", "*=": "align", "/=": "align", "|=": "align", "&=": "align", "=>": "align", "??=": "align", ">>=": "align", "<<=": "align"}}, "cast_spaces": {"space": "single"}, "class_attributes_separation": { "elements": {"const": "one", "method": "one", "property": "one"} }, "combine_consecutive_issets": true, "compact_nullable_typehint": true, "declare_strict_types": true, "declare_equal_normalize": {"space": "none"}, "elseif": true, "encoding": true, "explicit_indirect_variable": true, "explicit_string_variable": true, "function_to_constant": true, "implode_call": true, "increment_style": {"style": "pre"}, "is_null": true, "yoda_style": {"equal": false, "identical": false, "less_and_greater": false}, "line_ending": true, "logical_operators": true, "lowercase_cast": true, "constant_case": {"case": "lower"}, "lowercase_keywords": true, "modernize_types_casting": true, "native_constant_invocation": true, "native_function_casing": true, "native_function_invocation": {"include": ["@all"]}, "new_with_braces": true, "no_extra_blank_lines": {"tokens": ["break", "case", "continue", "curly_brace_block", "extra", "return", "switch", "throw", "use"]}, "no_spaces_after_function_name": true, "no_alias_functions": true, "no_closing_tag": true, "no_empty_comment": true, "no_empty_phpdoc": true, "no_empty_statement": true, "no_homoglyph_names": true, "no_mixed_echo_print": {"use": "echo"}, "no_php4_constructor": true, "no_singleline_whitespace_before_semicolons": true, "no_spaces_inside_parenthesis": true, "no_trailing_whitespace": true, "no_unneeded_final_method": true, "no_unused_imports": true, "no_useless_return": true, "no_whitespace_before_comma_in_array": true, "no_whitespace_in_blank_line": true, "non_printable_character": true, "normalize_index_brace": true, "ordered_imports": {"sort_algorithm": "alpha"}, "ordered_interfaces": {"order": "alpha"}, "php_unit_construct": true, "php_unit_internal_class": true, "php_unit_set_up_tear_down_visibility": true, "phpdoc_indent": true, "phpdoc_align": {"align": "vertical"}, "phpdoc_annotation_without_dot": true, "phpdoc_scalar": true, "phpdoc_return_self_reference": {"replacements": {"this": "self"}}, "phpdoc_trim": true, "phpdoc_trim_consecutive_blank_line_separation": true, "random_api_migration": true, "self_accessor": true, "return_type_declaration": {"space_before": "one"}, "semicolon_after_instruction": true, "set_type_to_cast": true, "short_scalar_cast": true, "single_blank_line_at_eof": true, "single_line_after_imports": true, "standardize_increment": true, "trailing_comma_in_multiline": true, "trim_array_spaces": true, "visibility_required": true, "void_return": true}'' --allow-risky=yes'
- name: Check for modified files
id: git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)

View File

@ -14,8 +14,6 @@ declare(strict_types=1);
namespace Modules\Admin\Admin\Install;
use Model\Setting;
use Model\SettingMapper;
use Modules\Admin\Models\SettingsEnum;
use phpOMS\Application\ApplicationAbstract;
@ -47,34 +45,34 @@ class Media
[
'data' => [
[
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_LIST_EXPORTS,
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_LIST_EXPORTS,
'content' => (string) $media['collection'][4]['id'],
'pattern' => '\\d+',
'module' => 'Admin'
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_LETTERS,
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_LETTERS,
'content' => (string) $media['collection'][5]['id'],
'pattern' => '\\d+',
'module' => 'Admin'
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_ASSETS,
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_ASSETS,
'content' => (string) $media['upload'][0]['id'],
'pattern' => '\\d+',
'module' => 'Admin'
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_TEMPLATES,
'type' => 'setting',
'name' => SettingsEnum::DEFAULT_TEMPLATES,
'content' => (string) $media['upload'][1]['id'],
'pattern' => '\\d+',
'module' => 'Admin'
]
]
'module' => 'Admin',
],
],
]
);
}

View File

@ -15,7 +15,6 @@ declare(strict_types=1);
use PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter;
use PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing;
use PhpOffice\PhpSpreadsheet\Worksheet\PageSetup;
use phpOMS\Autoloader;
class DefaultExcel extends \PhpOffice\PhpSpreadsheet\Spreadsheet
{
@ -48,5 +47,4 @@ class DefaultExcel extends \PhpOffice\PhpSpreadsheet\Spreadsheet
->addImage($drawing, HeaderFooter::IMAGE_HEADER_LEFT);
*/
}
}

View File

@ -52,40 +52,40 @@ class DefaultPdf extends TCPDF
public array $lang = [
'en' => [
'Page' => 'Page',
'CEO' => 'CEO',
'TaxOffice' => 'Tax office',
'TaxNumber' => 'Tax number',
'Swift' => 'BIC',
'Page' => 'Page',
'CEO' => 'CEO',
'TaxOffice' => 'Tax office',
'TaxNumber' => 'Tax number',
'Swift' => 'BIC',
'BankAccount' => 'Account',
],
'de' => [
'Page' => 'Seite',
'CEO' => 'Geschäftsführer',
'TaxOffice' => 'Finanzamt',
'TaxNumber' => 'Steuernummer',
'Swift' => 'BIC',
'Page' => 'Seite',
'CEO' => 'Geschäftsführer',
'TaxOffice' => 'Finanzamt',
'TaxNumber' => 'Steuernummer',
'Swift' => 'BIC',
'BankAccount' => 'IBAN',
]
],
];
public array $attributes = [
'logo' => __DIR__ . '/../Web/Backend/img/logo.png',
'title_name' => 'Jingga',
'slogan' => 'Business solutions made simple.',
'legal_name' => '',
'address' => '',
'city' => '',
'country' => '',
'ceo' => '',
'tax_office' => '',
'tax_number' => '',
'bank_name' => '',
'swift' => '',
'logo' => __DIR__ . '/../Web/Backend/img/logo.png',
'title_name' => 'Jingga',
'slogan' => 'Business solutions made simple.',
'legal_name' => '',
'address' => '',
'city' => '',
'country' => '',
'ceo' => '',
'tax_office' => '',
'tax_number' => '',
'bank_name' => '',
'swift' => '',
'bank_account' => '',
'website' => '',
'email' => '',
'phone' => '',
'website' => '',
'email' => '',
'phone' => '',
];
/**
@ -154,7 +154,7 @@ class DefaultPdf extends TCPDF
$x = 0;
$dx = 0;
if (!$this->header_xobj_autoreset AND $this->booklet AND (($this->page % 2) == 0)) {
if (!$this->header_xobj_autoreset && $this->booklet && (($this->page % 2) == 0)) {
// adjust margins for booklet mode
$dx = ($this->original_lMargin - $this->original_rMargin);
}

View File

@ -42,40 +42,40 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord
public array $lang = [
'en' => [
'Page' => 'Page',
'CEO' => 'CEO',
'TaxOffice' => 'Tax office',
'TaxNumber' => 'Tax number',
'Swift' => 'BIC',
'Page' => 'Page',
'CEO' => 'CEO',
'TaxOffice' => 'Tax office',
'TaxNumber' => 'Tax number',
'Swift' => 'BIC',
'BankAccount' => 'Account',
],
'de' => [
'Page' => 'Seite',
'CEO' => 'Geschäftsführer',
'TaxOffice' => 'Finanzamt',
'TaxNumber' => 'Steuernummer',
'Swift' => 'BIC',
'Page' => 'Seite',
'CEO' => 'Geschäftsführer',
'TaxOffice' => 'Finanzamt',
'TaxNumber' => 'Steuernummer',
'Swift' => 'BIC',
'BankAccount' => 'IBAN',
]
],
];
public array $attributes = [
'logo' => __DIR__ . '/../Web/Backend/img/logo.png',
'title_name' => 'Jingga',
'slogan' => 'Business solutions made simple.',
'legal_name' => '',
'address' => '',
'city' => '',
'country' => '',
'ceo' => '',
'tax_office' => '',
'tax_number' => '',
'bank_name' => '',
'swift' => '',
'logo' => __DIR__ . '/../Web/Backend/img/logo.png',
'title_name' => 'Jingga',
'slogan' => 'Business solutions made simple.',
'legal_name' => '',
'address' => '',
'city' => '',
'country' => '',
'ceo' => '',
'tax_office' => '',
'tax_number' => '',
'bank_name' => '',
'swift' => '',
'bank_account' => '',
'website' => '',
'email' => '',
'phone' => '',
'website' => '',
'email' => '',
'phone' => '',
];
/**
@ -94,9 +94,9 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord
public function createFirstPage()
{
$section = $this->addSection([
'marginLeft' => 1000,
'marginRight' => 1000,
'marginTop' => 2000,
'marginLeft' => 1000,
'marginRight' => 1000,
'marginTop' => 2000,
'marginBottom' => 2000,
// 'headerHeight' => 50,
// 'footerHeight' => 50,
@ -170,9 +170,9 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord
public function createSecondPage()
{
$section = $this->addSection([
'marginLeft' => 1000,
'marginRight' => 1000,
'marginTop' => 2000,
'marginLeft' => 1000,
'marginRight' => 1000,
'marginTop' => 2000,
'marginBottom' => 2000,
// 'headerHeight' => 50,
// 'footerHeight' => 50,

View File

@ -14,8 +14,6 @@ declare(strict_types=1);
namespace Modules\Admin\Admin\Install;
use Model\Setting;
use Model\SettingMapper;
use Modules\Admin\Models\SettingsEnum;
use phpOMS\Application\ApplicationAbstract;
use phpOMS\Message\Http\HttpRequest;
@ -51,22 +49,22 @@ class Messages
$settings = [
[
'id' => null,
'name' => SettingsEnum::LOGIN_MAIL_REGISTRATION_TEMPLATE,
'id' => null,
'name' => SettingsEnum::LOGIN_MAIL_REGISTRATION_TEMPLATE,
'content' => (string) $messages['email_template'][0]['id'],
'module' => 'Admin',
'module' => 'Admin',
],
[
'id' => null,
'name' => SettingsEnum::LOGIN_MAIL_FORGOT_PASSWORD_TEMPLATE,
'id' => null,
'name' => SettingsEnum::LOGIN_MAIL_FORGOT_PASSWORD_TEMPLATE,
'content' => (string) $messages['email_template'][1]['id'],
'module' => 'Admin',
'module' => 'Admin',
],
[
'id' => null,
'name' => SettingsEnum::LOGIN_MAIL_FAILED_TEMPLATE,
'id' => null,
'name' => SettingsEnum::LOGIN_MAIL_FAILED_TEMPLATE,
'content' => (string) $messages['email_template'][2]['id'],
'module' => 'Admin',
'module' => 'Admin',
],
];

View File

@ -142,10 +142,10 @@ return [
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_PASS,
'content' => '',
'module' => 'Admin',
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_PASS,
'content' => '',
'module' => 'Admin',
'encrypted' => true,
],
[
@ -155,17 +155,17 @@ return [
'module' => 'Admin',
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_KEY,
'content' => '',
'module' => 'Admin',
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_KEY,
'content' => '',
'module' => 'Admin',
'encrypted' => true,
],
[
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_KEYPASS,
'content' => '',
'module' => 'Admin',
'type' => 'setting',
'name' => SettingsEnum::MAIL_SERVER_KEYPASS,
'content' => '',
'module' => 'Admin',
'encrypted' => true,
],
[

View File

@ -279,7 +279,7 @@ final class ApiController extends Controller
$response->set($request->uri->__toString(), [
'status' => NotificationLevel::ERROR,
'title' => $this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'PasswordResetTitle'),
'message' => $this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'PasswordResetMsg'),
'message' => $this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'PasswordResetMsg'),
'response' => null,
]);
}
@ -333,8 +333,8 @@ final class ApiController extends Controller
$response->header->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
$response->set($request->uri->__toString(), [
'status' => NotificationLevel::OK,
'title' => $this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'PasswordResetTitle'),
'message' => $this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'PasswordResetEmailMsg'),
'title' => $this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'PasswordResetTitle'),
'message' => $this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'PasswordResetEmailMsg'),
'response' => null,
]);
}
@ -372,7 +372,7 @@ final class ApiController extends Controller
$response->set($request->uri->__toString(), [
'status' => NotificationLevel::OK,
'title' => $this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'PasswordResetTitle'),
'message' => $this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'PasswordResetInvalidMsg'),
'message' => $this->app->l11nManager->getText($response->getLanguage(), 'Admin', 'Api', 'PasswordResetInvalidMsg'),
'response' => null,
]);
@ -523,22 +523,22 @@ final class ApiController extends Controller
$dataSettings = $request->getDataJson('settings');
foreach ($dataSettings as $data) {
$id = isset($data['id']) && !empty($data['id']) ? (int) $data['id'] : null;
$name = $data['name'] ?? null;
$content = $data['content'] ?? null;
$unit = $data['unit'] ?? null;
$app = $data['app'] ?? null;
$module = $data['module'] ?? null;
$pattern = $data['pattern'] ?? '';
$encrypted = $data['encrypted'] ?? null;
$group = isset($data['group']) ? (int) $data['group'] : null;
$account = isset($data['account']) ? (int) $data['account'] : null;
$id = isset($data['id']) && !empty($data['id']) ? (int) $data['id'] : null;
$name = $data['name'] ?? null;
$content = $data['content'] ?? null;
$unit = $data['unit'] ?? null;
$app = $data['app'] ?? null;
$module = $data['module'] ?? null;
$pattern = $data['pattern'] ?? '';
$encrypted = $data['encrypted'] ?? null;
$group = isset($data['group']) ? (int) $data['group'] : null;
$account = isset($data['account']) ? (int) $data['account'] : null;
/** @var \Model\Setting $old */
$old = $this->app->appSettings->get($id, $name, $unit, $app, $module, $group, $account);
if ($old->id === 0) {
$internalResponse = new HttpResponse();
$internalRequest = new HttpRequest($request->uri);
$internalRequest = new HttpRequest($request->uri);
$internalRequest->header->account = $request->header->account;
$internalRequest->setData('id', $id);
@ -559,30 +559,30 @@ final class ApiController extends Controller
$new = clone $old;
$new->name = $name ?? $new->name;
$new->name = $name ?? $new->name;
$new->isEncrypted = $encrypted ?? $new->isEncrypted;
$new->content = $new->isEncrypted && !empty($content) && !empty($_SERVER['OMS_PRIVATE_KEY_I'] ?? '')
$new->content = $new->isEncrypted && !empty($content) && !empty($_SERVER['OMS_PRIVATE_KEY_I'] ?? '')
? EncryptionHelper::encryptShared($content, $_SERVER['OMS_PRIVATE_KEY_I'])
: $content ?? $new->content;
$new->unit = $unit ?? $new->unit;
$new->app = $app ?? $new->app;
$new->module = $module ?? $new->module;
$new->group = $group ?? $new->group;
$new->account = $account ?? $new->account;
$new->unit = $unit ?? $new->unit;
$new->app = $app ?? $new->app;
$new->module = $module ?? $new->module;
$new->group = $group ?? $new->group;
$new->account = $account ?? $new->account;
// @todo: this function call seems stupid, it should just pass the $new object.
$this->app->appSettings->set([
[
'id' => $new->id,
'name' => $new->name,
'content' => $new->content,
'unit' => $new->unit,
'app' => $new->app,
'module' => $new->module,
'group' => $new->group,
'account' => $new->account,
'id' => $new->id,
'name' => $new->name,
'content' => $new->content,
'unit' => $new->unit,
'app' => $new->app,
'module' => $new->module,
'group' => $new->group,
'account' => $new->account,
'isEncrypted' => $new->isEncrypted,
]
],
], false);
$this->updateModel($request->header->account, $old, $new, SettingMapper::class, 'settings', $request->getOrigin());
@ -1758,7 +1758,7 @@ final class ApiController extends Controller
$dataChange->createdBy = $account->id;
$dataChange->data = \json_encode([
'status' => AccountStatus::ACTIVE
'status' => AccountStatus::ACTIVE,
]);
$tries = 0;
@ -1827,7 +1827,7 @@ final class ApiController extends Controller
UriFactory::hasQuery('/' . \strtolower($app->name))
? UriFactory::build('{/' . \strtolower($app->name) . '}/' . \strtolower($app->name) . '/signup/confirmation?hash=' . $dataChange->getHash())
: UriFactory::build('{/tld}/{/lang}/' . \strtolower($app->name) . '/signup/confirmation?hash=' . $dataChange->getHash()),
$account->login
$account->login,
],
$mailL11n->body
);
@ -1841,7 +1841,7 @@ final class ApiController extends Controller
UriFactory::hasQuery('/' . \strtolower($app->name))
? UriFactory::build('{/' . \strtolower($app->name) . '}/' . \strtolower($app->name) . '/signup/confirmation?hash=' . $dataChange->getHash())
: UriFactory::build('{/tld}/{/lang}/' . \strtolower($app->name) . '/signup/confirmation?hash=' . $dataChange->getHash()),
$account->login
$account->login,
],
$mailL11n->bodyAlt
);

View File

@ -14,10 +14,7 @@ declare(strict_types=1);
namespace Modules\Admin\Models;
use phpOMS\Account\AccountStatus;
use phpOMS\Auth\LoginReturnType;
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
use phpOMS\DataStorage\Database\Query\Builder;
/**
* Account mapper class.
@ -39,14 +36,14 @@ class AccountExternalMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'account_external_id' => ['name' => 'account_external_id', 'type' => 'int', 'internal' => 'id'],
'account_external_status' => ['name' => 'account_external_status', 'type' => 'int', 'internal' => 'status'],
'account_external_type' => ['name' => 'account_external_type', 'type' => 'int', 'internal' => 'type'],
'account_external_id' => ['name' => 'account_external_id', 'type' => 'int', 'internal' => 'id'],
'account_external_status' => ['name' => 'account_external_status', 'type' => 'int', 'internal' => 'status'],
'account_external_type' => ['name' => 'account_external_type', 'type' => 'int', 'internal' => 'type'],
'account_external_subtype' => ['name' => 'account_external_subtype', 'type' => 'int', 'internal' => 'subtype'],
'account_external_key' => ['name' => 'account_external_key', 'type' => 'string', 'internal' => 'key'],
'account_external_name' => ['name' => 'account_external_name', 'type' => 'string', 'internal' => 'name'],
'account_external_auth' => ['name' => 'account_external_auth', 'type' => 'string', 'internal' => 'auth', ],
'account_external_account' => ['name' => 'account_external_account', 'type' => 'int', 'internal' => 'account'],
'account_external_key' => ['name' => 'account_external_key', 'type' => 'string', 'internal' => 'key'],
'account_external_name' => ['name' => 'account_external_name', 'type' => 'string', 'internal' => 'name'],
'account_external_auth' => ['name' => 'account_external_auth', 'type' => 'string', 'internal' => 'auth', ],
'account_external_account' => ['name' => 'account_external_account', 'type' => 'int', 'internal' => 'account'],
];
/**

View File

@ -46,8 +46,8 @@ final class AddressMapper extends DataMapperFactory
'address_city' => ['name' => 'address_city', 'type' => 'string', 'internal' => 'city'],
'address_country' => ['name' => 'address_country', 'type' => 'string', 'internal' => 'country'],
'address_type' => ['name' => 'address_type', 'type' => 'int', 'internal' => 'type'],
'address_lat' => ['name' => 'address_lat', 'type' => 'float', 'internal' => 'lat'],
'address_lon' => ['name' => 'address_lon', 'type' => 'float', 'internal' => 'lon'],
'address_lat' => ['name' => 'address_lat', 'type' => 'float', 'internal' => 'lat'],
'address_lon' => ['name' => 'address_lon', 'type' => 'float', 'internal' => 'lon'],
];
/**

View File

@ -36,11 +36,11 @@ final class AppMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'app_id' => ['name' => 'app_id', 'type' => 'int', 'internal' => 'id'],
'app_name' => ['name' => 'app_name', 'type' => 'string', 'internal' => 'name'],
'app_theme' => ['name' => 'app_theme', 'type' => 'string', 'internal' => 'theme'],
'app_status' => ['name' => 'app_status', 'type' => 'int', 'internal' => 'status'],
'app_type' => ['name' => 'app_type', 'type' => 'int', 'internal' => 'type'],
'app_id' => ['name' => 'app_id', 'type' => 'int', 'internal' => 'id'],
'app_name' => ['name' => 'app_name', 'type' => 'string', 'internal' => 'name'],
'app_theme' => ['name' => 'app_theme', 'type' => 'string', 'internal' => 'theme'],
'app_status' => ['name' => 'app_status', 'type' => 'int', 'internal' => 'status'],
'app_type' => ['name' => 'app_type', 'type' => 'int', 'internal' => 'type'],
'app_unit_default' => ['name' => 'app_unit_default', 'type' => 'int', 'internal' => 'defaultUnit'],
];

View File

@ -41,7 +41,7 @@ final class ContactMapper extends DataMapperFactory
'account_contact_subtype' => ['name' => 'account_contact_subtype', 'type' => 'int', 'internal' => 'subtype'],
'account_contact_order' => ['name' => 'account_contact_order', 'type' => 'int', 'internal' => 'order'],
'account_contact_content' => ['name' => 'account_contact_content', 'type' => 'string', 'internal' => 'content'],
'account_contact_module' => ['name' => 'account_contact_module', 'type' => 'string', 'internal' => 'module'],
'account_contact_module' => ['name' => 'account_contact_module', 'type' => 'string', 'internal' => 'module'],
'account_contact_account' => ['name' => 'account_contact_account', 'type' => 'int', 'internal' => 'account'],
];

View File

@ -36,10 +36,10 @@ final class DataChangeMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'data_change_id' => ['name' => 'data_change_id', 'type' => 'int', 'internal' => 'id'],
'data_change_type' => ['name' => 'data_change_type', 'type' => 'string', 'internal' => 'type'],
'data_change_hash' => ['name' => 'data_change_hash', 'type' => 'string', 'internal' => 'hash'],
'data_change_data' => ['name' => 'data_change_data', 'type' => 'string', 'internal' => 'data'],
'data_change_id' => ['name' => 'data_change_id', 'type' => 'int', 'internal' => 'id'],
'data_change_type' => ['name' => 'data_change_type', 'type' => 'string', 'internal' => 'type'],
'data_change_hash' => ['name' => 'data_change_hash', 'type' => 'string', 'internal' => 'hash'],
'data_change_data' => ['name' => 'data_change_data', 'type' => 'string', 'internal' => 'data'],
'data_change_created_by' => ['name' => 'data_change_created_by', 'type' => 'int', 'internal' => 'createdBy'],
'data_change_created_at' => ['name' => 'data_change_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'],
];

View File

@ -25,7 +25,8 @@ use phpOMS\Stdlib\Base\Enum;
* @since 1.0.0
*/
abstract class SettingsEnum extends Enum
{ /* Logging settings */
{
/* Logging settings */
public const PASSWORD_PATTERN = '1000000001';
public const LOGIN_TIMEOUT = '1000000002';

View File

@ -29,6 +29,6 @@ return ['Navigation' => [
'Pages' => 'Pages',
'Permissions' => 'Permissions',
'Routes' => 'Routes',
'Hooks' => 'Hooks',
'Hooks' => 'Hooks',
'Settings' => 'Settings',
]];

View File

@ -13,186 +13,186 @@
declare(strict_types=1);
return ['Admin' => [
':s1' => 'Active',
':s2' => 'Inactive',
':s3' => 'Timeout',
':s4' => 'Banned',
'Account' => 'Account',
'Account/Group' => 'Account/Group',
'Accounts' => 'Accounts',
'Activate' => 'Activate',
'Active' => 'Active',
'Activity' => 'Activity',
'Address' => 'Address',
'All' => 'All',
'Amount' => 'Amount',
'App' => 'App',
'Area' => 'Area',
'AuditLog' => 'Audit Log',
'Available' => 'Available',
'Banned' => 'Banned',
'Cache' => 'Cache',
'Change' => 'Change',
'Children' => 'Children',
'City' => 'City',
'Close' => 'Close',
'Comp' => 'Comp.',
'Component' => 'Component',
'Country' => 'Country',
'Create' => 'Create',
'CreateProfile' => 'Create Profile',
'Created' => 'Created',
'CreatedBy' => 'Created By',
'Currency' => 'Currency',
'Currencyformat' => 'Currency Format',
'Customized' => 'Customized',
'Deactivate' => 'Deactivate',
'DecimalPoint' => 'Decimal Point',
'Defaults' => 'Defaults',
'Delete' => 'Delete',
'Description' => 'Description',
'Design' => 'Design',
'Destination' => 'Destination',
'Ele' => 'Ele.',
'Element' => 'Element',
'Email' => 'Email',
'EmailAdmin' => 'Email Admin',
'Fast' => 'Fast',
'Features' => 'Features',
'File' => 'File',
'General' => 'General',
'Glass' => 'Glass',
'Group' => 'Group',
'GroupStatus1' => 'Active',
'GroupStatus2' => 'Inactive',
'GroupStatus4' => 'Hidden',
'Groups' => 'Groups',
'Heavy' => 'Heavy',
'Images' => 'Images',
'Inactive' => 'Inactive',
'Install' => 'Install',
'Installed' => 'Installed',
'LAddress' => 'Local Address',
'Language' => 'Language',
'Large' => 'Large',
'Length' => 'Length',
'Light' => 'Light',
'Load' => 'Load',
'Localization' => 'Localization',
'Log' => 'Log',
'LogPath' => 'Log Path',
'Logging' => 'Logging',
'LoginImage' => 'Login Image',
'LoginRetries' => 'Login Retries',
'Loginname' => 'Login Name',
'Long' => 'Long',
'Lowercase' => 'Lowercase',
'Maintenance' => 'Maintenance',
'Medium' => 'Medium',
'Member' => 'Member',
'Members' => 'Members',
'Memcache' => 'Memcache',
'MemoryLimit' => 'Memory Limit',
'Message' => 'Message',
'Module' => 'Module',
'Modules' => 'Modules',
'Name' => 'Name',
'Name1' => 'Name 1',
'Name2' => 'Name 2',
'Name3' => 'Name 3',
'None' => 'None',
'Numberformat' => 'Numberformat',
'Numeric' => 'Numeric',
'Organization' => 'Organization',
'OrganizationName' => 'Organization Name',
'Page' => 'Page',
'Parent' => 'Parent',
'Parents' => 'Parents',
'Password' => 'Password',
'PasswordChangeInterval' => 'Password Change Interval (days)',
'PasswordHistory' => 'Password History',
'PasswordRegex' => 'Password Regex',
'Perm' => 'Perm.',
'Permission' => 'Permission',
'Permissions' => 'Permissions',
'Person' => 'Person',
'Precision' => 'Precision',
'Profile' => 'Profile',
'RAddress' => 'Remote Address',
'ReCache' => 'Re-Cache',
'Read' => 'Read',
'Release' => 'Release',
'Reset' => 'Reset',
'Route' => 'Route',
'Routes' => 'Routes',
'Hook' => 'Hook',
'Hooks' => 'Hooks',
'Running' => 'Running',
'Sea' => 'Sea',
'Search' => 'Search',
'Security' => 'Security',
'Settings' => 'Settings',
'SettingsGeneral' => 'Settings - General',
'Short' => 'Short',
'Single' => 'Single',
'Slow' => 'Slow',
'Small' => 'Small',
'Specialchar' => 'Special character',
'Speed' => 'Speed',
'Status' => 'Status',
'Status0' => 'None',
'Status1' => 'Active',
'Status2' => 'Inactive',
'Status3' => 'Timehout',
'Status4' => 'Banned',
'Tablespoon' => 'Tablespoon',
'Teaspoon' => 'Teaspoon',
'Temperature' => 'Temperature',
'Theme' => 'Theme',
'ThousandsSeparator' => 'Thousands Separator',
'Time' => 'Time',
'Timeformat' => 'Timeformat',
'Timeout' => 'Timeout',
'TimeoutPeriod' => 'Timeout Period (minutes)',
'Timestamp' => 'Timestamp',
'Timezone' => 'Timezone',
'Total' => 'Total',
'Type' => 'Type',
'Uninstall' => 'Uninstall',
'Unit' => 'Unit',
'Update' => 'Update',
'Uppercase' => 'Uppercase',
'Username' => 'Username',
'Value' => 'Value',
'Verb' => 'Verb',
'Version' => 'Version',
'VeryFast' => 'Very Fast',
'VeryHeavy' => 'Very Heavy',
'VeryLarge' => 'Very Large',
'VeryLight' => 'Very Light',
'VeryLong' => 'Very Long',
'VeryShort' => 'Very Short',
'VerySlow' => 'Very Slow',
'VerySmall' => 'Very Small',
'Volume' => 'Volume',
'Warnings' => 'Warnings',
'Website' => 'Website',
'Weight' => 'Weight',
'Zip' => 'Zip',
'Trigger' => 'Trigger',
':s1' => 'Active',
':s2' => 'Inactive',
':s3' => 'Timeout',
':s4' => 'Banned',
'Account' => 'Account',
'Account/Group' => 'Account/Group',
'Accounts' => 'Accounts',
'Activate' => 'Activate',
'Active' => 'Active',
'Activity' => 'Activity',
'Address' => 'Address',
'All' => 'All',
'Amount' => 'Amount',
'App' => 'App',
'Area' => 'Area',
'AuditLog' => 'Audit Log',
'Available' => 'Available',
'Banned' => 'Banned',
'Cache' => 'Cache',
'Change' => 'Change',
'Children' => 'Children',
'City' => 'City',
'Close' => 'Close',
'Comp' => 'Comp.',
'Component' => 'Component',
'Country' => 'Country',
'Create' => 'Create',
'CreateProfile' => 'Create Profile',
'Created' => 'Created',
'CreatedBy' => 'Created By',
'Currency' => 'Currency',
'Currencyformat' => 'Currency Format',
'Customized' => 'Customized',
'Deactivate' => 'Deactivate',
'DecimalPoint' => 'Decimal Point',
'Defaults' => 'Defaults',
'Delete' => 'Delete',
'Description' => 'Description',
'Design' => 'Design',
'Destination' => 'Destination',
'Ele' => 'Ele.',
'Element' => 'Element',
'Email' => 'Email',
'EmailAdmin' => 'Email Admin',
'Fast' => 'Fast',
'Features' => 'Features',
'File' => 'File',
'General' => 'General',
'Glass' => 'Glass',
'Group' => 'Group',
'GroupStatus1' => 'Active',
'GroupStatus2' => 'Inactive',
'GroupStatus4' => 'Hidden',
'Groups' => 'Groups',
'Heavy' => 'Heavy',
'Images' => 'Images',
'Inactive' => 'Inactive',
'Install' => 'Install',
'Installed' => 'Installed',
'LAddress' => 'Local Address',
'Language' => 'Language',
'Large' => 'Large',
'Length' => 'Length',
'Light' => 'Light',
'Load' => 'Load',
'Localization' => 'Localization',
'Log' => 'Log',
'LogPath' => 'Log Path',
'Logging' => 'Logging',
'LoginImage' => 'Login Image',
'LoginRetries' => 'Login Retries',
'Loginname' => 'Login Name',
'Long' => 'Long',
'Lowercase' => 'Lowercase',
'Maintenance' => 'Maintenance',
'Medium' => 'Medium',
'Member' => 'Member',
'Members' => 'Members',
'Memcache' => 'Memcache',
'MemoryLimit' => 'Memory Limit',
'Message' => 'Message',
'Module' => 'Module',
'Modules' => 'Modules',
'Name' => 'Name',
'Name1' => 'Name 1',
'Name2' => 'Name 2',
'Name3' => 'Name 3',
'None' => 'None',
'Numberformat' => 'Numberformat',
'Numeric' => 'Numeric',
'Organization' => 'Organization',
'OrganizationName' => 'Organization Name',
'Page' => 'Page',
'Parent' => 'Parent',
'Parents' => 'Parents',
'Password' => 'Password',
'PasswordChangeInterval' => 'Password Change Interval (days)',
'PasswordHistory' => 'Password History',
'PasswordRegex' => 'Password Regex',
'Perm' => 'Perm.',
'Permission' => 'Permission',
'Permissions' => 'Permissions',
'Person' => 'Person',
'Precision' => 'Precision',
'Profile' => 'Profile',
'RAddress' => 'Remote Address',
'ReCache' => 'Re-Cache',
'Read' => 'Read',
'Release' => 'Release',
'Reset' => 'Reset',
'Route' => 'Route',
'Routes' => 'Routes',
'Hook' => 'Hook',
'Hooks' => 'Hooks',
'Running' => 'Running',
'Sea' => 'Sea',
'Search' => 'Search',
'Security' => 'Security',
'Settings' => 'Settings',
'SettingsGeneral' => 'Settings - General',
'Short' => 'Short',
'Single' => 'Single',
'Slow' => 'Slow',
'Small' => 'Small',
'Specialchar' => 'Special character',
'Speed' => 'Speed',
'Status' => 'Status',
'Status0' => 'None',
'Status1' => 'Active',
'Status2' => 'Inactive',
'Status3' => 'Timehout',
'Status4' => 'Banned',
'Tablespoon' => 'Tablespoon',
'Teaspoon' => 'Teaspoon',
'Temperature' => 'Temperature',
'Theme' => 'Theme',
'ThousandsSeparator' => 'Thousands Separator',
'Time' => 'Time',
'Timeformat' => 'Timeformat',
'Timeout' => 'Timeout',
'TimeoutPeriod' => 'Timeout Period (minutes)',
'Timestamp' => 'Timestamp',
'Timezone' => 'Timezone',
'Total' => 'Total',
'Type' => 'Type',
'Uninstall' => 'Uninstall',
'Unit' => 'Unit',
'Update' => 'Update',
'Uppercase' => 'Uppercase',
'Username' => 'Username',
'Value' => 'Value',
'Verb' => 'Verb',
'Version' => 'Version',
'VeryFast' => 'Very Fast',
'VeryHeavy' => 'Very Heavy',
'VeryLarge' => 'Very Large',
'VeryLight' => 'Very Light',
'VeryLong' => 'Very Long',
'VeryShort' => 'Very Short',
'VerySlow' => 'Very Slow',
'VerySmall' => 'Very Small',
'Volume' => 'Volume',
'Warnings' => 'Warnings',
'Website' => 'Website',
'Weight' => 'Weight',
'Zip' => 'Zip',
'Trigger' => 'Trigger',
'ServerStatus' => 'Server Status',
'ServerMode-1' => 'Normal',
'ServerMode-2' => 'Read Only',
'ServerMode-3' => 'Disabled',
'i:LoginRetries' => 'Amount of allowed retries (-1 = unlimited)',
'i:PasswordChangeInterval' => 'Interval in which passwards need to be changed (-1 = never)',
'i:PasswordHistory' => 'New password has to be different from the last N passwords',
'i:PasswordRegex' => 'Password requirement for users',
'i:TimeoutPeriod' => 'Timeout period after too many logins',
'i:loc' => 'IP address or URL for remote access.',
'i:mail' => 'Email address.',
'i:oname' => 'Organization name.',
'i:rc' => 'Forcing re-cache for every user.',
'i:rem' => 'IP address or URL for remote access.',
'i:timef' => 'Time format.',
'i:LoginRetries' => 'Amount of allowed retries (-1 = unlimited)',
'i:PasswordChangeInterval' => 'Interval in which passwards need to be changed (-1 = never)',
'i:PasswordHistory' => 'New password has to be different from the last N passwords',
'i:PasswordRegex' => 'Password requirement for users',
'i:TimeoutPeriod' => 'Timeout period after too many logins',
'i:loc' => 'IP address or URL for remote access.',
'i:mail' => 'Email address.',
'i:oname' => 'Organization name.',
'i:rc' => 'Forcing re-cache for every user.',
'i:rem' => 'IP address or URL for remote access.',
'i:timef' => 'Time format.',
]];

View File

@ -59,13 +59,13 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
protected string $appName = 'Api';
};
$this->app->dbPool = $GLOBALS['dbpool'];
$this->app->dbPool = $GLOBALS['dbpool'];
$this->app->unitId = 1;
$this->app->accountManager = new AccountManager($GLOBALS['session']);
$this->app->appSettings = new CoreSettings();
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
$this->app->dispatcher = new Dispatcher($this->app);
$this->app->eventManager = new EventManager($this->app->dispatcher);
$this->app->accountManager = new AccountManager($GLOBALS['session']);
$this->app->appSettings = new CoreSettings();
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
$this->app->dispatcher = new Dispatcher($this->app);
$this->app->eventManager = new EventManager($this->app->dispatcher);
$this->app->eventManager->importFromFile(__DIR__ . '/../../../../Web/Api/Hooks.php');
$this->app->sessionManager = new HttpSession(36000);
$this->app->l11nManager = new L11nManager();