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 - 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, "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 - 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

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@ $report = $this->getData('report');
/** @noinspection PhpIncludeInspection */ /** @noinspection PhpIncludeInspection */
$reportLanguage = include __DIR__ . '/../../../../' . \ltrim($tcoll['lang']->getPath(), '/'); $reportLanguage = include __DIR__ . '/../../../../' . \ltrim($tcoll['lang']->getPath(), '/');
$lang = $reportLanguage[$cLang]; $lang = $reportLanguage[$cLang];
require 'Worker.php'; 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($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, ',', '.') . '%'; ?> <td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%'; ?>
<?php <?php
$sum_hist += $history; $sum_hist += $history;
$sum_current += $current; $sum_current += $current;
$sum_forecast += $forecast; $sum_forecast += $forecast;
endforeach; ?> endforeach; ?>
<tr> <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($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, ',', '.') . '%'; ?> <td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%'; ?>
<?php <?php
$sum_hist += $history; $sum_hist += $history;
$sum_current += $current; $sum_current += $current;
$sum_forecast += $forecast; $sum_forecast += $forecast;
endforeach; ?> endforeach; ?>
<tr> <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($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, ',', '.') . '%'; ?> <td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%'; ?>
<?php <?php
$sum_hist += $history; $sum_hist += $history;
$sum_current += $current; $sum_current += $current;
$sum_forecast += $forecast; $sum_forecast += $forecast;
endforeach; ?> endforeach; ?>
<tr> <tr>

View File

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

View File

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

View File

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

View File

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

View File

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