phpcs autofixes

This commit is contained in:
Dennis Eichhorn 2023-05-28 12:19:04 +00:00
parent 9a219bb385
commit 0257b54735
10 changed files with 111 additions and 113 deletions

View File

@ -26,7 +26,7 @@ jobs:
- name: Setup Composer - name: Setup Composer
run: composer install run: composer install
- name: Autoformat - 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 - name: Check for modified files
id: git-check id: git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)

View File

@ -171,7 +171,7 @@ final class ApiController extends Controller
private function createSupplierL11nFromRequest(RequestAbstract $request) : BaseStringL11n private function createSupplierL11nFromRequest(RequestAbstract $request) : BaseStringL11n
{ {
$supplierL11n = new BaseStringL11n(); $supplierL11n = new BaseStringL11n();
$supplierL11n->ref = $request->getDataInt('supplier') ?? 0; $supplierL11n->ref = $request->getDataInt('supplier') ?? 0;
$supplierL11n->type = new NullBaseStringL11nType($request->getDataInt('type') ?? 0); $supplierL11n->type = new NullBaseStringL11nType($request->getDataInt('type') ?? 0);
$supplierL11n->setLanguage( $supplierL11n->setLanguage(
$request->getDataString('language') ?? $request->getLanguage() $request->getDataString('language') ?? $request->getLanguage()

View File

@ -70,7 +70,7 @@ class Supplier
private array $partners = []; private array $partners = [];
/** /**
* Payments. * Payments.
* *
* @var Payment[] * @var Payment[]

View File

@ -37,14 +37,14 @@ final class SupplierAttributeValueMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'suppliermgmt_attr_value_id' => ['name' => 'suppliermgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'], 'suppliermgmt_attr_value_id' => ['name' => 'suppliermgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'],
'suppliermgmt_attr_value_default' => ['name' => 'suppliermgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'], 'suppliermgmt_attr_value_default' => ['name' => 'suppliermgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
'suppliermgmt_attr_value_valueStr' => ['name' => 'suppliermgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'], 'suppliermgmt_attr_value_valueStr' => ['name' => 'suppliermgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
'suppliermgmt_attr_value_valueInt' => ['name' => 'suppliermgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'], 'suppliermgmt_attr_value_valueInt' => ['name' => 'suppliermgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
'suppliermgmt_attr_value_valueDec' => ['name' => 'suppliermgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'], 'suppliermgmt_attr_value_valueDec' => ['name' => 'suppliermgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
'suppliermgmt_attr_value_valueDat' => ['name' => 'suppliermgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'], 'suppliermgmt_attr_value_valueDat' => ['name' => 'suppliermgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
'suppliermgmt_attr_value_unit' => ['name' => 'suppliermgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'], 'suppliermgmt_attr_value_unit' => ['name' => 'suppliermgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
'suppliermgmt_attr_value_deptype' => ['name' => 'suppliermgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'], 'suppliermgmt_attr_value_deptype' => ['name' => 'suppliermgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
'suppliermgmt_attr_value_depvalue' => ['name' => 'suppliermgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'], 'suppliermgmt_attr_value_depvalue' => ['name' => 'suppliermgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
]; ];

View File

@ -37,11 +37,11 @@ final class SupplierL11nMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'suppliermgmt_supplier_l11n_id' => ['name' => 'suppliermgmt_supplier_l11n_id', 'type' => 'int', 'internal' => 'id'], 'suppliermgmt_supplier_l11n_id' => ['name' => 'suppliermgmt_supplier_l11n_id', 'type' => 'int', 'internal' => 'id'],
'suppliermgmt_supplier_l11n_description' => ['name' => 'suppliermgmt_supplier_l11n_description', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true], 'suppliermgmt_supplier_l11n_description' => ['name' => 'suppliermgmt_supplier_l11n_description', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'suppliermgmt_supplier_l11n_supplier' => ['name' => 'suppliermgmt_supplier_l11n_supplier', 'type' => 'int', 'internal' => 'ref'], 'suppliermgmt_supplier_l11n_supplier' => ['name' => 'suppliermgmt_supplier_l11n_supplier', 'type' => 'int', 'internal' => 'ref'],
'suppliermgmt_supplier_l11n_lang' => ['name' => 'suppliermgmt_supplier_l11n_lang', 'type' => 'string', 'internal' => 'language'], 'suppliermgmt_supplier_l11n_lang' => ['name' => 'suppliermgmt_supplier_l11n_lang', 'type' => 'string', 'internal' => 'language'],
'suppliermgmt_supplier_l11n_typeref' => ['name' => 'suppliermgmt_supplier_l11n_typeref', 'type' => 'int', 'internal' => 'type'], 'suppliermgmt_supplier_l11n_typeref' => ['name' => 'suppliermgmt_supplier_l11n_typeref', 'type' => 'int', 'internal' => 'type'],
]; ];
/** /**

View File

@ -14,93 +14,93 @@ declare(strict_types=1);
return ['SupplierManagement' => [ return ['SupplierManagement' => [
'AttributeTypes' => 'Attribute Types', 'AttributeTypes' => 'Attribute Types',
'Attribute' => 'Attribute', 'Attribute' => 'Attribute',
'Accounting' => 'Accounting', 'Accounting' => 'Accounting',
'Addition' => 'Addition', 'Addition' => 'Addition',
'Address' => 'Address', 'Address' => 'Address',
'Addresses' => 'Addresses', 'Addresses' => 'Addresses',
'AreaManager' => 'Area Manager', 'AreaManager' => 'Area Manager',
'Articlegroup' => 'Articlegroup', 'Articlegroup' => 'Articlegroup',
'Articles' => 'Articles', 'Articles' => 'Articles',
'Balance' => 'Balance', 'Balance' => 'Balance',
'Bonus' => 'Bonus', 'Bonus' => 'Bonus',
'Business' => 'Business', 'Business' => 'Business',
'CLV' => 'CLV', 'CLV' => 'CLV',
'Calendar' => 'Calendar', 'Calendar' => 'Calendar',
'City' => 'City', 'City' => 'City',
'Client' => 'Client', 'Client' => 'Client',
'Clients' => 'Clients', 'Clients' => 'Clients',
'Contact' => 'Contact', 'Contact' => 'Contact',
'Country' => 'Country', 'Country' => 'Country',
'Created' => 'Created', 'Created' => 'Created',
'CreatedAt' => 'Created at', 'CreatedAt' => 'Created at',
'CreditRating' => 'Credit Rating', 'CreditRating' => 'Credit Rating',
'Creditcard' => 'Creditcard', 'Creditcard' => 'Creditcard',
'DSO' => 'DSO', 'DSO' => 'DSO',
'DUE' => 'Due', 'DUE' => 'Due',
'Date' => 'Date', 'Date' => 'Date',
'Default' => 'Default', 'Default' => 'Default',
'Delivery' => 'Delivery', 'Delivery' => 'Delivery',
'Discount' => 'Discount', 'Discount' => 'Discount',
'DiscountP' => 'Discount %', 'DiscountP' => 'Discount %',
'Documents' => 'Documents', 'Documents' => 'Documents',
'Due' => 'Due', 'Due' => 'Due',
'Email' => 'Email', 'Email' => 'Email',
'Fax' => 'Fax', 'Fax' => 'Fax',
'Files' => 'Files', 'Files' => 'Files',
'Freightage' => 'Freightage', 'Freightage' => 'Freightage',
'Group' => 'Group', 'Group' => 'Group',
'ID' => 'ID', 'ID' => 'ID',
'Info' => 'Info', 'Info' => 'Info',
'Invoice' => 'Invoice', 'Invoice' => 'Invoice',
'Invoices' => 'Invoices', 'Invoices' => 'Invoices',
'IsDefault' => 'Is default', 'IsDefault' => 'Is default',
'LastContact' => 'Last Contact', 'LastContact' => 'Last Contact',
'LastOrder' => 'Last Order', 'LastOrder' => 'Last Order',
'Log' => 'Log', 'Log' => 'Log',
'Logs' => 'Logs', 'Logs' => 'Logs',
'MRR' => 'MRR', 'MRR' => 'MRR',
'MTDSales' => 'MTD Sales', 'MTDSales' => 'MTD Sales',
'Main' => 'Main', 'Main' => 'Main',
'Margin' => 'Margin', 'Margin' => 'Margin',
'Master' => 'Master', 'Master' => 'Master',
'Messages' => 'Messages', 'Messages' => 'Messages',
'Modified' => 'Modified', 'Modified' => 'Modified',
'Modules' => 'Modules', 'Modules' => 'Modules',
'Name' => 'Name', 'Name' => 'Name',
'Name1' => 'Name1', 'Name1' => 'Name1',
'Name2' => 'Name2', 'Name2' => 'Name2',
'Name3' => 'Name3', 'Name3' => 'Name3',
'Net' => 'Net', 'Net' => 'Net',
'Notes' => 'Notes', 'Notes' => 'Notes',
'Number' => 'Number', 'Number' => 'Number',
'Office' => 'Office', 'Office' => 'Office',
'Payment' => 'Payment', 'Payment' => 'Payment',
'PaymentTerm' => 'Payment Term', 'PaymentTerm' => 'Payment Term',
'Permission' => 'Permission', 'Permission' => 'Permission',
'Phone' => 'Phone', 'Phone' => 'Phone',
'Postal' => 'Postal', 'Postal' => 'Postal',
'Price' => 'Price', 'Price' => 'Price',
'Prices' => 'Prices', 'Prices' => 'Prices',
'Private' => 'Private', 'Private' => 'Private',
'Productgroup' => 'Productgroup', 'Productgroup' => 'Productgroup',
'Profile' => 'Profile', 'Profile' => 'Profile',
'Purchase' => 'Purchase', 'Purchase' => 'Purchase',
'Quantity' => 'Quantity', 'Quantity' => 'Quantity',
'RecentInvoices' => 'Recent Invoices', 'RecentInvoices' => 'Recent Invoices',
'Sales' => 'Sales', 'Sales' => 'Sales',
'Segment' => 'Segment', 'Segment' => 'Segment',
'Segments' => 'Segments', 'Segments' => 'Segments',
'Subtype' => 'Subtype', 'Subtype' => 'Subtype',
'Supplier' => 'Supplier', 'Supplier' => 'Supplier',
'Suppliers' => 'Suppliers', 'Suppliers' => 'Suppliers',
'Support' => 'Support', 'Support' => 'Support',
'Tags' => 'Tags', 'Tags' => 'Tags',
'Title' => 'Title', 'Title' => 'Title',
'Type' => 'Type', 'Type' => 'Type',
'Website' => 'Website', 'Website' => 'Website',
'Wire' => 'Wire', 'Wire' => 'Wire',
'YTDSales' => 'YTD Sales', 'YTDSales' => 'YTD Sales',
'Zip' => 'Zip', 'Zip' => 'Zip',
'IMG_alt_map' => 'Map', 'IMG_alt_map' => 'Map',
]]; ]];

View File

@ -15,7 +15,7 @@ declare(strict_types=1);
use phpOMS\Localization\ISO639Enum; use phpOMS\Localization\ISO639Enum;
$attribute = $this->getData('attribute'); $attribute = $this->getData('attribute');
$l11ns = $this->getData('l11ns'); $l11ns = $this->getData('l11ns');
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>

View File

@ -12,7 +12,6 @@
*/ */
declare(strict_types=1); declare(strict_types=1);
use Modules\Media\Models\NullMedia;
use phpOMS\Uri\UriFactory; use phpOMS\Uri\UriFactory;
/** @var \phpOMS\Views\View $this */ /** @var \phpOMS\Views\View $this */

View File

@ -14,7 +14,6 @@ declare(strict_types=1);
namespace Modules\SupplierManagement\tests\Controller\Api; namespace Modules\SupplierManagement\tests\Controller\Api;
use Modules\Profile\Models\ContactType;
use phpOMS\Localization\ISO3166TwoEnum; use phpOMS\Localization\ISO3166TwoEnum;
use phpOMS\Message\Http\HttpRequest; use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse; use phpOMS\Message\Http\HttpResponse;

View File

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