php cs autofix

This commit is contained in:
Dennis Eichhorn 2020-08-31 22:30:36 +02:00
parent 6f788ed84f
commit e41972ee21
10 changed files with 142 additions and 142 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, "cast_spaces": {"space": "single"}, "class_attributes_separation": { "elements": ["const", "method", "property"] }, "combine_consecutive_issets": true, "compact_nullable_typehint": true, "declare_strict_types": true, "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": {"use_yoda_style": false}, "line_ending": true, "logical_operators": true, "lowercase_cast": true, "lowercase_constants": true, "lowercase_keywords": true, "modernize_types_casting": true, "native_constant_invocation": true, "native_function_casing": true, "native_function_invocation": true, "new_with_braces": 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_ordered_covers": 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": {"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_array": 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, "binary_operator_spaces": {"operators": {"=": "align", ".=": "align", "+=": "align", "-=": "align", "*=": "align", "/=": "align", "|=": "align", "&=": "align", "=>": "align", "??=": "align"}}, "cast_spaces": {"space": "single"}, "class_attributes_separation": { "elements": ["const", "method", "property"] }, "combine_consecutive_issets": true, "compact_nullable_typehint": true, "declare_strict_types": true, "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": {"use_yoda_style": false}, "line_ending": true, "logical_operators": true, "lowercase_cast": true, "lowercase_constants": true, "lowercase_keywords": true, "modernize_types_casting": true, "native_constant_invocation": true, "native_function_casing": true, "native_function_invocation": true, "new_with_braces": 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_ordered_covers": 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": {"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_array": 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

@ -8,34 +8,34 @@ use phpOMS\Router\RouteVerb;
return [
'^.*/helper/report/export.*$' => [
[
'dest' => '\Modules\Helper\Controller\ApiController:apiHelperExport',
'verb' => RouteVerb::GET,
'dest' => '\Modules\Helper\Controller\ApiController:apiHelperExport',
'verb' => RouteVerb::GET,
'permission' => [
'module' => ApiController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::REPORT,
'type' => PermissionType::READ,
'state' => PermissionState::REPORT,
],
],
],
'^.*/helper/report/template.*$' => [
[
'dest' => '\Modules\Helper\Controller\ApiController:apiTemplateCreate',
'verb' => RouteVerb::SET,
'dest' => '\Modules\Helper\Controller\ApiController:apiTemplateCreate',
'verb' => RouteVerb::SET,
'permission' => [
'module' => ApiController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::TEMPLATE,
'type' => PermissionType::READ,
'state' => PermissionState::TEMPLATE,
],
],
],
'^.*/helper/report/report.*$' => [
[
'dest' => '\Modules\Helper\Controller\ApiController:apiReportCreate',
'verb' => RouteVerb::SET,
'dest' => '\Modules\Helper\Controller\ApiController:apiReportCreate',
'verb' => RouteVerb::SET,
'permission' => [
'module' => ApiController::MODULE_NAME,
'type' => PermissionType::CREATE,
'state' => PermissionState::REPORT,
'type' => PermissionType::CREATE,
'state' => PermissionState::REPORT,
],
],
],

View File

@ -8,63 +8,63 @@ use phpOMS\Router\RouteVerb;
return [
'^.*/helper/template/create.*$' => [
[
'dest' => '\Modules\Media\Controller\BackendController::setUpFileUploader',
'verb' => RouteVerb::GET,
'dest' => '\Modules\Media\Controller\BackendController::setUpFileUploader',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::CREATE,
'state' => PermissionState::TEMPLATE,
'type' => PermissionType::CREATE,
'state' => PermissionState::TEMPLATE,
],
],
[
'dest' => '\Modules\Helper\Controller\BackendController:viewTemplateCreate',
'verb' => RouteVerb::GET,
'dest' => '\Modules\Helper\Controller\BackendController:viewTemplateCreate',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::CREATE,
'state' => PermissionState::TEMPLATE,
'type' => PermissionType::CREATE,
'state' => PermissionState::TEMPLATE,
],
],
],
'^.*/helper/report/create.*$' => [
[
'dest' => '\Modules\Media\Controller\BackendController::setUpFileUploader',
'verb' => RouteVerb::GET,
'dest' => '\Modules\Media\Controller\BackendController::setUpFileUploader',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::CREATE,
'state' => PermissionState::REPORT,
'type' => PermissionType::CREATE,
'state' => PermissionState::REPORT,
],
],
[
'dest' => '\Modules\Helper\Controller\BackendController:viewReportCreate',
'verb' => RouteVerb::GET,
'dest' => '\Modules\Helper\Controller\BackendController:viewReportCreate',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::CREATE,
'state' => PermissionState::REPORT,
'type' => PermissionType::CREATE,
'state' => PermissionState::REPORT,
],
],
],
'^.*/helper/list.*$' => [
[
'dest' => '\Modules\Helper\Controller\BackendController:viewTemplateList',
'verb' => RouteVerb::GET,
'dest' => '\Modules\Helper\Controller\BackendController:viewTemplateList',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::REPORT,
'type' => PermissionType::READ,
'state' => PermissionState::REPORT,
],
],
],
'^.*/helper/report/view.*$' => [
[
'dest' => '\Modules\Helper\Controller\BackendController:viewHelperReport',
'verb' => RouteVerb::GET,
'dest' => '\Modules\Helper\Controller\BackendController:viewHelperReport',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::REPORT,
'type' => PermissionType::READ,
'state' => PermissionState::REPORT,
],
],
],

View File

@ -89,15 +89,15 @@ final class TemplateMapper extends DataMapperAbstract
*/
protected static array $hasMany = [
'reports' => [
'mapper' => ReportMapper::class,
'table' => 'helper_report',
'mapper' => ReportMapper::class,
'table' => 'helper_report',
'external' => 'helper_report_template',
'self' => null,
'self' => null,
],
'tags' => [
'mapper' => TagMapper::class,
'table' => 'helper_template_tag',
'self' => 'helper_template_tag_src',
'mapper' => TagMapper::class,
'table' => 'helper_template_tag',
'self' => 'helper_template_tag_src',
'external' => 'helper_template_tag_dst',
],
];

View File

@ -10,7 +10,7 @@ $report = $this->getData('report');
/** @noinspection PhpIncludeInspection */
$reportLanguage = include __DIR__ . '/../../../../' . \ltrim($tcoll['lang']->getPath(), '/');
$lang = $reportLanguage[$cLang];
$lang = $reportLanguage[$cLang];
require 'Worker.php';
?>
@ -103,8 +103,8 @@ require 'Worker.php';
<td><?= (\number_format($forecast = ($type[$key][$fiscal_end->format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')); ?>
<td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%'; ?>
<?php
$sum_hist += $history;
$sum_current += $current;
$sum_hist += $history;
$sum_current += $current;
$sum_forecast += $forecast;
endforeach; ?>
<tr>
@ -142,8 +142,8 @@ require 'Worker.php';
<td><?= (\number_format($forecast = ($costcenter[$key][$fiscal_end->format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')); ?>
<td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%'; ?>
<?php
$sum_hist += $history;
$sum_current += $current;
$sum_hist += $history;
$sum_current += $current;
$sum_forecast += $forecast;
endforeach; ?>
<tr>
@ -181,8 +181,8 @@ require 'Worker.php';
<td><?= (\number_format($forecast = ($account[$key][$fiscal_end->format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')); ?>
<td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%'; ?>
<?php
$sum_hist += $history;
$sum_current += $current;
$sum_hist += $history;
$sum_current += $current;
$sum_forecast += $forecast;
endforeach; ?>
<tr>

View File

@ -103,8 +103,8 @@ if (($path = \realpath($oPath = __DIR__ . '/' . $rcoll['entries.csv']->getPath()
$costobject[$line[9]][$year][$month] = 0.0;
}
$account[$line[10]][$year][$month] += $val;
$type[$t_name][$year][$month] += $val;
$account[$line[10]][$year][$month] += $val;
$type[$t_name][$year][$month] += $val;
$costcenter[$line[8]][$year][$month] += $val;
$costobject[$line[9]][$year][$month] += $val;
@ -173,19 +173,19 @@ if (($path = \realpath($oPath = __DIR__ . '/' . $rcoll['entries.csv']->getPath()
$costobject[$line[9]][$fiscal_year]['cc'][$line[8]] = 0.0;
}
$account[$line[10]][$fiscal_year]['value'] += $val;
$account[$line[10]][$fiscal_year]['cc'][$line[8]] += $val;
$account[$line[10]][$fiscal_year]['type'][$t_name] += $val;
$type[$t_name][$fiscal_year]['value'] += $val;
$type[$t_name][$fiscal_year]['cc'][$line[8]] += $val;
$type[$t_name][$fiscal_year]['ac'][$line[10]] += $val;
$costcenter[$line[8]][$fiscal_year]['value'] += $val;
$costcenter[$line[8]][$fiscal_year]['co'][$line[9]] += $val;
$account[$line[10]][$fiscal_year]['value'] += $val;
$account[$line[10]][$fiscal_year]['cc'][$line[8]] += $val;
$account[$line[10]][$fiscal_year]['type'][$t_name] += $val;
$type[$t_name][$fiscal_year]['value'] += $val;
$type[$t_name][$fiscal_year]['cc'][$line[8]] += $val;
$type[$t_name][$fiscal_year]['ac'][$line[10]] += $val;
$costcenter[$line[8]][$fiscal_year]['value'] += $val;
$costcenter[$line[8]][$fiscal_year]['co'][$line[9]] += $val;
$costcenter[$line[8]][$fiscal_year]['ac'][$line[10]] += $val;
$costcenter[$line[8]][$fiscal_year]['type'][$t_name] += $val;
$costobject[$line[9]][$fiscal_year]['value'] += $val;
$costobject[$line[9]][$fiscal_year]['value'] += $val;
$costobject[$line[9]][$fiscal_year]['ac'][$line[10]] += $val;
$costobject[$line[9]][$fiscal_year]['cc'][$line[8]] += $val;
$costobject[$line[9]][$fiscal_year]['cc'][$line[8]] += $val;
if (!isset($total[$fiscal_year])) {
$total[$fiscal_year] = 0.0;

View File

@ -48,38 +48,38 @@ class ReportMapperTest extends \PHPUnit\Framework\TestCase
$templateFiles = [
[
'extension' => 'php',
'filename' => 'EventCourse.lang.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'EventCourse.lang.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'php',
'filename' => 'EventCourse.pdf.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'EventCourse.pdf.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'php',
'filename' => 'EventCourse.tpl.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'EventCourse.tpl.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'php',
'filename' => 'EventCourse.xlsx.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'EventCourse.xlsx.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'php',
'filename' => 'Worker.php',
'name' => 'Worker',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'Worker.php',
'name' => 'Worker',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
],
];
@ -120,38 +120,38 @@ class ReportMapperTest extends \PHPUnit\Framework\TestCase
$reportFiles = [
[
'extension' => 'csv',
'filename' => 'accounts.csv',
'name' => 'accounts',
'path' => 'Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'accounts.csv',
'name' => 'accounts',
'path' => 'Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'csv',
'filename' => 'costcenters.csv',
'name' => 'costcenters',
'path' => 'Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'costcenters.csv',
'name' => 'costcenters',
'path' => 'Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'csv',
'filename' => 'costobjects.csv',
'name' => 'costobjects',
'path' => 'Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'costobjects.csv',
'name' => 'costobjects',
'path' => 'Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'csv',
'filename' => 'crm.csv',
'name' => 'crm',
'path' => 'Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'crm.csv',
'name' => 'crm',
'path' => 'Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'csv',
'filename' => 'entries.csv',
'name' => 'entries',
'path' => 'Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'entries.csv',
'name' => 'entries',
'path' => 'Demo/Modules/Helper/EventCourse',
'size' => 1,
],
];

View File

@ -143,11 +143,11 @@ class ReportTest extends \PHPUnit\Framework\TestCase
$array = $this->report->toArray();
$expected = [
'id' => 0,
'name' => 'testTitle',
'description' => 'testDescription',
'id' => 0,
'name' => 'testTitle',
'description' => 'testDescription',
'descriptionRaw' => 'testDescriptionRaw',
'status' => HelperStatus::INACTIVE,
'status' => HelperStatus::INACTIVE,
];
foreach ($expected as $key => $e) {
@ -173,11 +173,11 @@ class ReportTest extends \PHPUnit\Framework\TestCase
$array = $this->report->jsonSerialize();
$expected = [
'id' => 0,
'name' => 'testTitle',
'description' => 'testDescription',
'id' => 0,
'name' => 'testTitle',
'description' => 'testDescription',
'descriptionRaw' => 'testDescriptionRaw',
'status' => HelperStatus::INACTIVE,
'status' => HelperStatus::INACTIVE,
];
foreach ($expected as $key => $e) {

View File

@ -53,38 +53,38 @@ class TemplateMapperTest extends \PHPUnit\Framework\TestCase
$templateFiles = [
[
'extension' => 'php',
'filename' => 'EventCourse.lang.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'EventCourse.lang.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'php',
'filename' => 'EventCourse.pdf.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'EventCourse.pdf.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'php',
'filename' => 'EventCourse.tpl.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'EventCourse.tpl.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'php',
'filename' => 'EventCourse.xlsx.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'EventCourse.xlsx.php',
'name' => 'EventCourse',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
],
[
'extension' => 'php',
'filename' => 'Worker.php',
'name' => 'Worker',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
'filename' => 'Worker.php',
'name' => 'Worker',
'path' => '/Demo/Modules/Helper/EventCourse',
'size' => 1,
],
];

View File

@ -183,13 +183,13 @@ class TemplateTest extends \PHPUnit\Framework\TestCase
$array = $this->template->toArray();
$expected = [
'id' => 0,
'name' => 'testName',
'description' => 'testDescription',
'id' => 0,
'name' => 'testName',
'description' => 'testDescription',
'descriptionRaw' => 'testDescriptionRaw',
'status' => HelperStatus::INACTIVE,
'datatype' => TemplateDataType::OTHER,
'standalone' => true,
'status' => HelperStatus::INACTIVE,
'datatype' => TemplateDataType::OTHER,
'standalone' => true,
];
foreach ($expected as $key => $e) {
@ -215,13 +215,13 @@ class TemplateTest extends \PHPUnit\Framework\TestCase
$array = $this->template->jsonSerialize();
$expected = [
'id' => 0,
'name' => 'testName',
'description' => 'testDescription',
'id' => 0,
'name' => 'testName',
'description' => 'testDescription',
'descriptionRaw' => 'testDescriptionRaw',
'status' => HelperStatus::INACTIVE,
'datatype' => TemplateDataType::OTHER,
'standalone' => true,
'status' => HelperStatus::INACTIVE,
'datatype' => TemplateDataType::OTHER,
'standalone' => true,
];
foreach ($expected as $key => $e) {