From aebd57e311e12a332e392e2ad80a95397ecc77c8 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Wed, 8 Mar 2023 19:01:49 +0100 Subject: [PATCH] added translation domain for dashboard widgets (#3909) --- composer.lock | 64 +-- phpstan.neon | 380 ------------------ src/Controller/DashboardController.php | 3 +- .../Actions/DashboardSubscriber.php | 2 +- src/Widget/Type/AbstractWidget.php | 5 + src/Widget/WidgetInterface.php | 35 +- templates/dashboard/grid.html.twig | 2 +- .../Widget/Type/DailyWorkingTimeChartTest.php | 1 + 8 files changed, 53 insertions(+), 439 deletions(-) diff --git a/composer.lock b/composer.lock index 7a07375d..9d3b4c93 100644 --- a/composer.lock +++ b/composer.lock @@ -3051,16 +3051,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -3098,7 +3098,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -3106,7 +3106,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "myclabs/php-enum", @@ -10312,16 +10312,16 @@ }, { "name": "zircote/swagger-php", - "version": "4.7.1", + "version": "4.7.3", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "de32660ba43f7dd5f47a7a38d33d5d2c1c367d65" + "reference": "0299edc47eb4813a2c598a0348eaf205704adc92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/de32660ba43f7dd5f47a7a38d33d5d2c1c367d65", - "reference": "de32660ba43f7dd5f47a7a38d33d5d2c1c367d65", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/0299edc47eb4813a2c598a0348eaf205704adc92", + "reference": "0299edc47eb4813a2c598a0348eaf205704adc92", "shasum": "" }, "require": { @@ -10384,9 +10384,9 @@ ], "support": { "issues": "https://github.com/zircote/swagger-php/issues", - "source": "https://github.com/zircote/swagger-php/tree/4.7.1" + "source": "https://github.com/zircote/swagger-php/tree/4.7.3" }, - "time": "2023-02-25T22:37:20+00:00" + "time": "2023-03-08T02:27:27+00:00" } ], "packages-dev": [ @@ -10988,16 +10988,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.3", + "version": "v4.15.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", "shasum": "" }, "require": { @@ -11038,9 +11038,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" }, - "time": "2023-01-16T22:05:37+00:00" + "time": "2023-03-05T19:49:14+00:00" }, { "name": "phar-io/manifest", @@ -11155,16 +11155,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.3", + "version": "1.10.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "5419375b5891add97dc74be71e6c1c34baaddf64" + "reference": "1fb6f494d82455151ecf15c5c191923f5d84324e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5419375b5891add97dc74be71e6c1c34baaddf64", - "reference": "5419375b5891add97dc74be71e6c1c34baaddf64", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1fb6f494d82455151ecf15c5c191923f5d84324e", + "reference": "1fb6f494d82455151ecf15c5c191923f5d84324e", "shasum": "" }, "require": { @@ -11194,7 +11194,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.10.3" + "source": "https://github.com/phpstan/phpstan/tree/1.10.5" }, "funding": [ { @@ -11210,7 +11210,7 @@ "type": "tidelift" } ], - "time": "2023-02-25T14:47:13+00:00" + "time": "2023-03-07T16:48:45+00:00" }, { "name": "phpstan/phpstan-doctrine", @@ -11456,16 +11456,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.25", + "version": "9.2.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "0e2b40518197a8c0d4b08bc34dfff1c99c508954" + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0e2b40518197a8c0d4b08bc34dfff1c99c508954", - "reference": "0e2b40518197a8c0d4b08bc34dfff1c99c508954", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", "shasum": "" }, "require": { @@ -11487,8 +11487,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { @@ -11521,7 +11521,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.25" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" }, "funding": [ { @@ -11529,7 +11529,7 @@ "type": "github" } ], - "time": "2023-02-25T05:32:00+00:00" + "time": "2023-03-06T12:58:08+00:00" }, { "name": "phpunit/php-file-iterator", diff --git a/phpstan.neon b/phpstan.neon index 929e7167..055e1b0f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7740,26 +7740,6 @@ parameters: count: 1 path: src/Widget/Type/AbstractActiveUsers.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractActiveUsers\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AbstractActiveUsers.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractActiveUsers\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AbstractActiveUsers.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractAmountPeriod\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AbstractAmountPeriod.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractAmountPeriod\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AbstractAmountPeriod.php - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractAmountPeriod\\:\\:getRevenue\\(\\) has no return type specified\\.$#" count: 1 @@ -7775,16 +7755,6 @@ parameters: count: 1 path: src/Widget/Type/AbstractCounterDuration.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractCounterDuration\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AbstractCounterDuration.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractCounterDuration\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AbstractCounterDuration.php - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractCounterYear\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 @@ -7800,16 +7770,6 @@ parameters: count: 1 path: src/Widget/Type/AbstractSimpleStatisticChart.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractUserRevenuePeriod\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AbstractUserRevenuePeriod.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractUserRevenuePeriod\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AbstractUserRevenuePeriod.php - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractUserRevenuePeriod\\:\\:getRevenue\\(\\) has no return type specified\\.$#" count: 1 @@ -7820,16 +7780,6 @@ parameters: count: 1 path: src/Widget/Type/AbstractUserRevenuePeriod.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractWidget\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AbstractWidget.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractWidget\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AbstractWidget.php - - message: "#^Method App\\\\Widget\\\\Type\\\\AbstractWidget\\:\\:getUser\\(\\) should return App\\\\Entity\\\\User but returns App\\\\Entity\\\\User\\|null\\.$#" count: 1 @@ -7855,256 +7805,86 @@ parameters: count: 1 path: src/Widget/Type/ActiveTimesheets.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveTimesheets\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveTimesheets.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveTimesheets\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveTimesheets.php - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersMonth\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/ActiveUsersMonth.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersMonth\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveUsersMonth.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersMonth\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveUsersMonth.php - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersToday\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/ActiveUsersToday.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersToday\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveUsersToday.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersToday\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveUsersToday.php - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersTotal\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/ActiveUsersTotal.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersTotal\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveUsersTotal.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersTotal\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveUsersTotal.php - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersWeek\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/ActiveUsersWeek.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersWeek\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveUsersWeek.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersWeek\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveUsersWeek.php - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersYear\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/ActiveUsersYear.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersYear\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveUsersYear.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\ActiveUsersYear\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/ActiveUsersYear.php - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountMonth\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/AmountMonth.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountMonth\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AmountMonth.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountMonth\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AmountMonth.php - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountToday\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/AmountToday.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountToday\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AmountToday.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountToday\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AmountToday.php - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountTotal\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/AmountTotal.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountTotal\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AmountTotal.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountTotal\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AmountTotal.php - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountWeek\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/AmountWeek.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountWeek\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AmountWeek.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountWeek\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AmountWeek.php - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountYear\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/AmountYear.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountYear\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AmountYear.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\AmountYear\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/AmountYear.php - - message: "#^Method App\\\\Widget\\\\Type\\\\DailyWorkingTimeChart\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/DailyWorkingTimeChart.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\DailyWorkingTimeChart\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DailyWorkingTimeChart.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\DailyWorkingTimeChart\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DailyWorkingTimeChart.php - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationMonth\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/DurationMonth.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationMonth\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DurationMonth.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationMonth\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DurationMonth.php - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationToday\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/DurationToday.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationToday\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DurationToday.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationToday\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DurationToday.php - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationTotal\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/DurationTotal.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationTotal\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DurationTotal.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationTotal\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DurationTotal.php - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationWeek\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/DurationWeek.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationWeek\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DurationWeek.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationWeek\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DurationWeek.php - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationYear\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/DurationYear.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationYear\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DurationYear.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\DurationYear\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/DurationYear.php - - message: "#^Method App\\\\Widget\\\\Type\\\\More\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 @@ -8125,16 +7905,6 @@ parameters: count: 1 path: src/Widget/Type/PaginatedWorkingTimeChart.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\PaginatedWorkingTimeChart\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/PaginatedWorkingTimeChart.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\PaginatedWorkingTimeChart\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/PaginatedWorkingTimeChart.php - - message: "#^Strict comparison using \\!\\=\\= between App\\\\Entity\\\\User and null will always evaluate to true\\.$#" count: 1 @@ -8145,211 +7915,71 @@ parameters: count: 1 path: src/Widget/Type/TotalsActivity.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsActivity\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/TotalsActivity.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsActivity\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/TotalsActivity.php - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsCustomer\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/TotalsCustomer.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsCustomer\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/TotalsCustomer.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsCustomer\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/TotalsCustomer.php - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsProject\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/TotalsProject.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsProject\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/TotalsProject.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsProject\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/TotalsProject.php - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsUser\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/TotalsUser.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsUser\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/TotalsUser.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\TotalsUser\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/TotalsUser.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountMonth\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/UserAmountMonth.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountMonth\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserAmountMonth.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountMonth\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserAmountMonth.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountToday\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/UserAmountToday.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountToday\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserAmountToday.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountToday\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserAmountToday.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountTotal\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/UserAmountTotal.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountTotal\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserAmountTotal.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountTotal\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserAmountTotal.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountWeek\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/UserAmountWeek.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountWeek\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserAmountWeek.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountWeek\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserAmountWeek.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountYear\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/UserAmountYear.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountYear\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserAmountYear.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserAmountYear\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserAmountYear.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationMonth\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/UserDurationMonth.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationMonth\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserDurationMonth.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationMonth\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserDurationMonth.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationToday\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/UserDurationToday.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationToday\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserDurationToday.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationToday\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserDurationToday.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationTotal\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/UserDurationTotal.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationTotal\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserDurationTotal.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationTotal\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserDurationTotal.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationWeek\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/UserDurationWeek.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationWeek\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserDurationWeek.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationWeek\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserDurationWeek.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationYear\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 path: src/Widget/Type/UserDurationYear.php - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationYear\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserDurationYear.php - - - - message: "#^Method App\\\\Widget\\\\Type\\\\UserDurationYear\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/Type/UserDurationYear.php - - message: "#^Method App\\\\Widget\\\\Type\\\\UserTeamProjects\\:\\:getData\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" count: 1 @@ -8375,16 +8005,6 @@ parameters: count: 1 path: src/Widget/WidgetInterface.php - - - message: "#^Method App\\\\Widget\\\\WidgetInterface\\:\\:getOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/WidgetInterface.php - - - - message: "#^Method App\\\\Widget\\\\WidgetInterface\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Widget/WidgetInterface.php - - message: "#^Property App\\\\Widget\\\\WidgetService\\:\\:\\$widgets type has no value type specified in iterable type array\\.$#" count: 1 diff --git a/src/Controller/DashboardController.php b/src/Controller/DashboardController.php index 4978ebea..d58ced45 100644 --- a/src/Controller/DashboardController.php +++ b/src/Controller/DashboardController.php @@ -245,6 +245,8 @@ final class DashboardController extends AbstractController $choices = []; + // the list of widgets for the dropdown is created in the EventListener and not here + // this form is mainly used for saving foreach ($available as $widget) { if (empty($widget->getTitle())) { continue; @@ -293,7 +295,6 @@ final class DashboardController extends AbstractController return $this->render('dashboard/grid.html.twig', [ 'page_setup' => $page, 'widgets' => $widgets, - 'available' => $available, 'form' => $form->createView(), ]); } diff --git a/src/EventSubscriber/Actions/DashboardSubscriber.php b/src/EventSubscriber/Actions/DashboardSubscriber.php index a6cb4a27..4382a29c 100644 --- a/src/EventSubscriber/Actions/DashboardSubscriber.php +++ b/src/EventSubscriber/Actions/DashboardSubscriber.php @@ -67,7 +67,7 @@ final class DashboardSubscriber extends AbstractActionsSubscriber continue; } - $event->addActionToSubmenu('widget_add', $widget->getId(), ['url' => $this->path('dashboard_add', ['widget' => $widget->getId()]), 'title' => $widget->getTitle()]); + $event->addActionToSubmenu('widget_add', $widget->getId(), ['url' => $this->path('dashboard_add', ['widget' => $widget->getId()]), 'title' => $widget->getTitle(), 'translation_domain' => $widget->getTranslationDomain()]); } $event->addAction('reset', ['title' => 'action.reset', 'url' => $this->path('dashboard_reset'), 'icon' => 'delete', 'class' => 'confirmation-link', 'attr' => ['data-question' => 'confirm.delete']]); diff --git a/src/Widget/Type/AbstractWidget.php b/src/Widget/Type/AbstractWidget.php index ab572ce5..a187b853 100644 --- a/src/Widget/Type/AbstractWidget.php +++ b/src/Widget/Type/AbstractWidget.php @@ -18,6 +18,11 @@ abstract class AbstractWidget implements WidgetInterface private array $options = []; private ?User $user = null; + public function getTranslationDomain(): string + { + return 'messages'; + } + public function hasForm(): bool { return false; diff --git a/src/Widget/WidgetInterface.php b/src/Widget/WidgetInterface.php index 55df3c56..82990ae7 100644 --- a/src/Widget/WidgetInterface.php +++ b/src/Widget/WidgetInterface.php @@ -12,6 +12,10 @@ namespace App\Widget; use App\Entity\User; use Symfony\Component\Form\Form; +/** + * No BC promise! + * Use AbstractWidget to get a BC safe base class. + */ interface WidgetInterface { public const COLOR_TODAY = 'green'; @@ -32,37 +36,31 @@ interface WidgetInterface /** * Returns a unique ID for this widget. - * - * @return string */ public function getId(): string; /** * Returns the widget title (must be non-empty). - * - * @return string */ public function getTitle(): string; + /** + * Returns the translation domain used by this widget. + */ + public function getTranslationDomain(): string; + /** * Returns the height for this widget. - * - * @return int */ public function getHeight(): int; /** * Returns the width for this widget. - * - * @return int */ public function getWidth(): int; /** * Injects the current user. - * - * @param User $user - * @return void */ public function setUser(User $user): void; @@ -87,8 +85,8 @@ interface WidgetInterface * You can validate the options or simply return: * return array_merge($this->options, $options); * - * @param array $options - * @return array + * @param array $options + * @return array */ public function getOptions(array $options = []): array; @@ -96,9 +94,6 @@ interface WidgetInterface * Sets one widget option, both for internal use and for frontend rendering. * * The given option should be persisted and permanently overwrite the internal option. - * - * @param string $name - * @param string|bool|int $value */ public function setOption(string $name, string|bool|int $value): void; @@ -112,29 +107,21 @@ interface WidgetInterface /** * Returns the template, which is used to render the widget. - * - * @return string */ public function getTemplateName(): string; /** * Whether this widget can be configured with options. - * - * @return bool */ public function hasForm(): bool; /** * A form to edit the widget options or null, if it can't be configured. - * - * @return Form|null */ public function getForm(): ?Form; /** * Whether this is a widget that is supposed to be selectable by the end-user. - * - * @return bool */ public function isInternal(): bool; } diff --git a/templates/dashboard/grid.html.twig b/templates/dashboard/grid.html.twig index cde785e7..788c06f1 100644 --- a/templates/dashboard/grid.html.twig +++ b/templates/dashboard/grid.html.twig @@ -46,7 +46,7 @@
-

{{ widget.title|trans }}

+

{{ widget.title|trans({}, widget.translationDomain) }}

{% if widget.hasForm() %} {{ card_tool_button('configuration', {'title': 'settings', 'translation_domain': 'actions', 'class': 'modal-ajax-form', 'url': path('tasks_create')}) }} diff --git a/tests/Widget/Type/DailyWorkingTimeChartTest.php b/tests/Widget/Type/DailyWorkingTimeChartTest.php index 6062d401..9b3fb695 100644 --- a/tests/Widget/Type/DailyWorkingTimeChartTest.php +++ b/tests/Widget/Type/DailyWorkingTimeChartTest.php @@ -61,6 +61,7 @@ class DailyWorkingTimeChartTest extends TestCase $sut = $this->createSut(); $options = $sut->getOptions(['type' => 'xxx']); + self::assertIsString($options['id']); self::assertStringStartsWith('DailyWorkingTimeChart_', $options['id']); self::assertEquals('xxx', $options['type']); }