diff --git a/composer.json b/composer.json
index f336b3fc..8e5f12bb 100644
--- a/composer.json
+++ b/composer.json
@@ -84,6 +84,7 @@
"fakerphp/faker": "^1.15",
"friendsofphp/php-cs-fixer": "^3.3",
"phpstan/phpstan": "^1.0",
+ "phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
diff --git a/composer.lock b/composer.lock
index 59dde827..fedab928 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "24f571304052968a6a7f49cac1109c5b",
+ "content-hash": "e857da36ba58dbba786a711ffe4f6320",
"packages": [
{
"name": "azuyalabs/yasumi",
@@ -2374,16 +2374,16 @@
},
{
"name": "kevinpapst/tabler-bundle",
- "version": "1.3.0",
+ "version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/kevinpapst/TablerBundle.git",
- "reference": "b4519deb2cb9fff3493c108c73a13af54401b5e8"
+ "reference": "d957405e18589a351856e4b7b8670731a5c34896"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/kevinpapst/TablerBundle/zipball/b4519deb2cb9fff3493c108c73a13af54401b5e8",
- "reference": "b4519deb2cb9fff3493c108c73a13af54401b5e8",
+ "url": "https://api.github.com/repos/kevinpapst/TablerBundle/zipball/d957405e18589a351856e4b7b8670731a5c34896",
+ "reference": "d957405e18589a351856e4b7b8670731a5c34896",
"shasum": ""
},
"require": {
@@ -2431,7 +2431,7 @@
"description": "Admin/Backend theme bundle for Symfony based on Tabler.io",
"support": {
"issues": "https://github.com/kevinpapst/TablerBundle/issues",
- "source": "https://github.com/kevinpapst/TablerBundle/tree/1.3.0"
+ "source": "https://github.com/kevinpapst/TablerBundle/tree/1.4.0"
},
"funding": [
{
@@ -2443,7 +2443,7 @@
"type": "github"
}
],
- "time": "2024-02-12T16:13:20+00:00"
+ "time": "2024-04-12T10:09:29+00:00"
},
{
"name": "league/csv",
@@ -3110,16 +3110,16 @@
},
{
"name": "nelmio/api-doc-bundle",
- "version": "v4.25.1",
+ "version": "4.25.2",
"source": {
"type": "git",
"url": "https://github.com/nelmio/NelmioApiDocBundle.git",
- "reference": "f594e600bf5943008562be35c4acd60957434d22"
+ "reference": "fc5d60d74b63806f7d6bb80b8393db1a12ae2dbc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/f594e600bf5943008562be35c4acd60957434d22",
- "reference": "f594e600bf5943008562be35c4acd60957434d22",
+ "url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/fc5d60d74b63806f7d6bb80b8393db1a12ae2dbc",
+ "reference": "fc5d60d74b63806f7d6bb80b8393db1a12ae2dbc",
"shasum": ""
},
"require": {
@@ -3153,8 +3153,11 @@
"friendsofsymfony/rest-bundle": "^2.8|^3.0",
"jms/serializer": "^1.14|^3.0",
"jms/serializer-bundle": "^2.3|^3.0|^4.0|^5.0",
+ "phpstan/phpstan": "^1.10",
+ "phpstan/phpstan-phpunit": "^1.3",
+ "phpstan/phpstan-strict-rules": "^1.5",
+ "phpstan/phpstan-symfony": "^1.3",
"phpunit/phpunit": "^8.5|^9.6",
- "sensio/framework-extra-bundle": "^5.4|^6.0",
"symfony/asset": "^5.4|^6.0|^7.0",
"symfony/browser-kit": "^5.4|^6.0|^7.0",
"symfony/cache": "^5.4|^6.0|^7.0",
@@ -3216,9 +3219,9 @@
],
"support": {
"issues": "https://github.com/nelmio/NelmioApiDocBundle/issues",
- "source": "https://github.com/nelmio/NelmioApiDocBundle/tree/v4.25.1"
+ "source": "https://github.com/nelmio/NelmioApiDocBundle/tree/4.25.2"
},
- "time": "2024-04-04T08:16:08+00:00"
+ "time": "2024-04-06T12:08:11+00:00"
},
{
"name": "nelmio/cors-bundle",
@@ -3613,28 +3616,35 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "5.3.0",
+ "version": "5.4.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "622548b623e81ca6d78b721c5e029f4ce664f170"
+ "reference": "298d2febfe79d03fe714eb871d5538da55205b1a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170",
- "reference": "622548b623e81ca6d78b721c5e029f4ce664f170",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/298d2febfe79d03fe714eb871d5538da55205b1a",
+ "reference": "298d2febfe79d03fe714eb871d5538da55205b1a",
"shasum": ""
},
"require": {
+ "doctrine/deprecations": "^1.1",
"ext-filter": "*",
- "php": "^7.2 || ^8.0",
+ "php": "^7.4 || ^8.0",
"phpdocumentor/reflection-common": "^2.2",
- "phpdocumentor/type-resolver": "^1.3",
+ "phpdocumentor/type-resolver": "^1.7",
+ "phpstan/phpdoc-parser": "^1.7",
"webmozart/assert": "^1.9.1"
},
"require-dev": {
- "mockery/mockery": "~1.3.2",
- "psalm/phar": "^4.8"
+ "mockery/mockery": "~1.3.5",
+ "phpstan/extension-installer": "^1.1",
+ "phpstan/phpstan": "^1.8",
+ "phpstan/phpstan-mockery": "^1.1",
+ "phpstan/phpstan-webmozart-assert": "^1.2",
+ "phpunit/phpunit": "^9.5",
+ "vimeo/psalm": "^5.13"
},
"type": "library",
"extra": {
@@ -3658,15 +3668,15 @@
},
{
"name": "Jaap van Otterdijk",
- "email": "account@ijaap.nl"
+ "email": "opensource@ijaap.nl"
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
- "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.0"
},
- "time": "2021-10-19T17:43:47+00:00"
+ "time": "2024-04-09T21:13:58+00:00"
},
{
"name": "phpdocumentor/type-resolver",
@@ -10769,16 +10779,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
- "version": "v3.52.1",
+ "version": "v3.53.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
- "reference": "6e77207f0d851862ceeb6da63e6e22c01b1587bc"
+ "reference": "69a19093a9ded8d1baac62ed6c009b8bc148d008"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/6e77207f0d851862ceeb6da63e6e22c01b1587bc",
- "reference": "6e77207f0d851862ceeb6da63e6e22c01b1587bc",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/69a19093a9ded8d1baac62ed6c009b8bc148d008",
+ "reference": "69a19093a9ded8d1baac62ed6c009b8bc148d008",
"shasum": ""
},
"require": {
@@ -10802,6 +10812,7 @@
},
"require-dev": {
"facile-it/paraunit": "^1.3 || ^2.0",
+ "infection/infection": "^0.27.11",
"justinrainbow/json-schema": "^5.2",
"keradus/cli-executor": "^2.1",
"mikey179/vfsstream": "^1.6.11",
@@ -10849,7 +10860,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
- "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.52.1"
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.53.0"
},
"funding": [
{
@@ -10857,7 +10868,7 @@
"type": "github"
}
],
- "time": "2024-03-19T21:02:43+00:00"
+ "time": "2024-04-08T15:03:00+00:00"
},
{
"name": "masterminds/html5",
@@ -11164,6 +11175,54 @@
],
"time": "2024-03-28T16:17:31+00:00"
},
+ {
+ "name": "phpstan/phpstan-deprecation-rules",
+ "version": "1.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpstan-deprecation-rules.git",
+ "reference": "089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa",
+ "reference": "089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0",
+ "phpstan/phpstan": "^1.10.3"
+ },
+ "require-dev": {
+ "php-parallel-lint/php-parallel-lint": "^1.2",
+ "phpstan/phpstan-php-parser": "^1.1",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^9.5"
+ },
+ "type": "phpstan-extension",
+ "extra": {
+ "phpstan": {
+ "includes": [
+ "rules.neon"
+ ]
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PHPStan\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.",
+ "support": {
+ "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues",
+ "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.1.4"
+ },
+ "time": "2023-08-05T09:02:04+00:00"
+ },
{
"name": "phpstan/phpstan-doctrine",
"version": "1.3.65",
@@ -11290,21 +11349,21 @@
},
{
"name": "phpstan/phpstan-strict-rules",
- "version": "1.5.2",
+ "version": "1.5.3",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
- "reference": "7a50e9662ee9f3942e4aaaf3d603653f60282542"
+ "reference": "568210bd301f94a0d4b1e5a0808c374c1b9cf11b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/7a50e9662ee9f3942e4aaaf3d603653f60282542",
- "reference": "7a50e9662ee9f3942e4aaaf3d603653f60282542",
+ "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/568210bd301f94a0d4b1e5a0808c374c1b9cf11b",
+ "reference": "568210bd301f94a0d4b1e5a0808c374c1b9cf11b",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0",
- "phpstan/phpstan": "^1.10.34"
+ "phpstan/phpstan": "^1.10.60"
},
"require-dev": {
"nikic/php-parser": "^4.13.0",
@@ -11333,22 +11392,22 @@
"description": "Extra strict and opinionated rules for PHPStan",
"support": {
"issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
- "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.2"
+ "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.3"
},
- "time": "2023-10-30T14:35:06+00:00"
+ "time": "2024-04-06T07:43:25+00:00"
},
{
"name": "phpstan/phpstan-symfony",
- "version": "1.3.9",
+ "version": "1.3.11",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-symfony.git",
- "reference": "a32bc86da24495025d7aafd1ba62444d4a364a98"
+ "reference": "3fbf634b2495adaa1dc4b7300293f8abf74128d8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/a32bc86da24495025d7aafd1ba62444d4a364a98",
- "reference": "a32bc86da24495025d7aafd1ba62444d4a364a98",
+ "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/3fbf634b2495adaa1dc4b7300293f8abf74128d8",
+ "reference": "3fbf634b2495adaa1dc4b7300293f8abf74128d8",
"shasum": ""
},
"require": {
@@ -11405,9 +11464,9 @@
"description": "Symfony Framework extensions and rules for PHPStan",
"support": {
"issues": "https://github.com/phpstan/phpstan-symfony/issues",
- "source": "https://github.com/phpstan/phpstan-symfony/tree/1.3.9"
+ "source": "https://github.com/phpstan/phpstan-symfony/tree/1.3.11"
},
- "time": "2024-03-16T16:50:20+00:00"
+ "time": "2024-04-12T07:42:40+00:00"
},
{
"name": "phpunit/php-code-coverage",
diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml
index c8ec072f..6c8ae96a 100644
--- a/config/packages/doctrine.yaml
+++ b/config/packages/doctrine.yaml
@@ -23,6 +23,8 @@ doctrine:
types:
datetime: App\Doctrine\UTCDateTimeType
orm:
+ controller_resolver:
+ auto_mapping: true
auto_generate_proxy_classes: '%kernel.debug%'
default_entity_manager: default
enable_lazy_ghost_objects: true
diff --git a/config/packages/security.yaml b/config/packages/security.yaml
index f236d88b..03c9cdf1 100644
--- a/config/packages/security.yaml
+++ b/config/packages/security.yaml
@@ -20,6 +20,7 @@ security:
api:
access_token:
token_handler: App\API\Authentication\AccessTokenHandler
+ remember_me: false
request_matcher: App\API\Authentication\ApiRequestMatcher
user_checker: App\Security\UserChecker
stateless: true
@@ -92,7 +93,7 @@ security:
- { path: '^/(%app_locales%)/register', role: PUBLIC_ACCESS }
- { path: '^/(%app_locales%)/resetting', role: PUBLIC_ACCESS }
- { path: '^/(%app_locales%)/', roles: ROLE_USER }
- - { path: '^/api', roles: IS_AUTHENTICATED_REMEMBERED }
+ - { path: '^/api', roles: IS_AUTHENTICATED }
when@test:
# this configuration simplifies testing URLs protected by the security mechanism
diff --git a/phpstan.neon b/phpstan.neon
index 28451043..d1ec845a 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -4,6 +4,7 @@ includes:
- %rootDir%/../phpstan-doctrine/extension.neon
- %rootDir%/../phpstan-doctrine/rules.neon
- %rootDir%/../phpstan-strict-rules/rules.neon
+ - %rootDir%/../phpstan-deprecation-rules/rules.neon
- %rootDir%/../phpstan/conf/bleedingEdge.neon
parameters:
@@ -3447,11 +3448,6 @@ parameters:
count: 1
path: src/Invoice/Calculator/AbstractMergedCalculator.php
- -
- message: "#^Cannot call method format\\(\\) on DateTime\\|null\\.$#"
- count: 2
- path: src/Invoice/Hydrator/InvoiceItemDefaultHydrator.php
-
-
message: "#^Cannot call method getCurrency\\(\\) on App\\\\Entity\\\\Customer\\|null\\.$#"
count: 1
@@ -3462,26 +3458,11 @@ parameters:
count: 1
path: src/Invoice/Hydrator/InvoiceItemDefaultHydrator.php
- -
- message: "#^Cannot call method getTimestamp\\(\\) on DateTime\\|null\\.$#"
- count: 2
- path: src/Invoice/Hydrator/InvoiceItemDefaultHydrator.php
-
-
message: "#^Method App\\\\Invoice\\\\Hydrator\\\\InvoiceItemDefaultHydrator\\:\\:hydrate\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Invoice/Hydrator/InvoiceItemDefaultHydrator.php
- -
- message: "#^Parameter \\#1 \\$date of method App\\\\Invoice\\\\InvoiceFormatter\\:\\:getFormattedDateTime\\(\\) expects DateTimeInterface, DateTime\\|null given\\.$#"
- count: 3
- path: src/Invoice/Hydrator/InvoiceItemDefaultHydrator.php
-
- -
- message: "#^Parameter \\#1 \\$date of method App\\\\Invoice\\\\InvoiceFormatter\\:\\:getFormattedTime\\(\\) expects DateTimeInterface, DateTime\\|null given\\.$#"
- count: 2
- path: src/Invoice/Hydrator/InvoiceItemDefaultHydrator.php
-
-
message: "#^Method App\\\\Invoice\\\\Hydrator\\\\InvoiceModelActivityHydrator\\:\\:getBudgetValues\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
@@ -5572,95 +5553,15 @@ parameters:
count: 1
path: src/Voter/TimesheetVoter.php
- -
- message: "#^Cannot access offset 'billable' on mixed\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Cannot access offset 'day' on mixed\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Cannot access offset 'details' on mixed\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Cannot access offset 'duration' on mixed\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Cannot access offset 'month' on mixed\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Cannot access offset 'rate' on mixed\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Cannot access offset 'year' on mixed\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
-
message: "#^Cannot call method getCustomer\\(\\) on App\\\\Entity\\\\Project\\|null\\.$#"
count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Cannot call method getId\\(\\) on App\\\\Entity\\\\Activity\\|null\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
+ path: src/Widget/Type/DailyWorkingTimeChart.php
-
message: "#^Cannot call method getId\\(\\) on App\\\\Entity\\\\Customer\\|null\\.$#"
count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Cannot call method getId\\(\\) on App\\\\Entity\\\\Project\\|null\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Cannot cast mixed to float\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Cannot cast mixed to int\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Parameter \\#1 \\$details of method App\\\\Model\\\\Statistic\\\\Day\\:\\:setDetails\\(\\) expects array, mixed given\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Parameter \\#1 \\$seconds of method App\\\\Model\\\\Statistic\\\\Day\\:\\:setTotalDurationBillable\\(\\) expects int, mixed given\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Parameter \\#1 \\$year of method DateTime\\:\\:setDate\\(\\) expects int, mixed given\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Parameter \\#2 \\$month of method DateTime\\:\\:setDate\\(\\) expects int, mixed given\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
-
- -
- message: "#^Parameter \\#3 \\$day of method DateTime\\:\\:setDate\\(\\) expects int, mixed given\\.$#"
- count: 1
- path: src/Widget/DataProvider/DailyWorkingTimeChartProvider.php
+ path: src/Widget/Type/DailyWorkingTimeChart.php
-
message: "#^Method App\\\\Widget\\\\Type\\\\AbstractWidget\\:\\:getUser\\(\\) should return App\\\\Entity\\\\User but returns App\\\\Entity\\\\User\\|null\\.$#"
diff --git a/public/.htaccess b/public/.htaccess
index 416790f4..74677b9b 100644
--- a/public/.htaccess
+++ b/public/.htaccess
@@ -1,3 +1,5 @@
+# See https://github.com/symfony/recipes-contrib/blob/main/symfony/apache-pack/1.0/public/.htaccess#L38
+
# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
@@ -5,30 +7,41 @@
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex index.php
-# Do NOT use Kimai with http, this is a huge security risk!
-# Activate these lines if you configured SSL and certificates:
+# By default, Apache does not evaluate symbolic links if you did not enable this
+# feature in your server configuration. Uncomment the following line if you
+# install assets as symlinks or if you experience problems related to symlinks
+# when compiling LESS/Sass/CoffeScript assets.
+# Options +SymLinksIfOwnerMatch
-#
{{ secret }}
{{ 'profile.2fa_confirmation'|trans }}
{{ form_widget(form) }} {{ form_end(form) }} + {% else %} + {{ 'activated'|trans }} {% endif %} {% endblock %} {% block javascripts %} {{ parent() }} + {% if not user.totpAuthenticationEnabled %} + {% endif %} {% endblock %} diff --git a/templates/user/api-token.html.twig b/templates/user/api-token.html.twig index 90ade444..78540822 100644 --- a/templates/user/api-token.html.twig +++ b/templates/user/api-token.html.twig @@ -5,20 +5,20 @@- {{ 'api_password.intro'|trans }} -
-- URL: {{ url('api.swagger_ui', {}, false)|replace({'/doc': ''}) }} -
-+ {{ 'api_password.intro'|trans }} +
++ URL: {{ url('api.swagger_ui', {}, false)|replace({'/doc': ''}) }} +
+| {{ 'name'|trans }} | @@ -81,6 +81,7 @@ {% embed '@theme/embeds/collapsible.html.twig' with {id: 'activity_invoice_settings'} %} {% import "macros/widgets.html.twig" as widgets %} {% block title %}{{ 'password'|trans }}{% endblock %} + {% block box_class %}mt-3{% endblock %} {% block body %} {{ widgets.alert('danger', 'api_password_deprecated'|trans) }} {{ form_start(form) }} diff --git a/tests/Configuration/SystemConfigurationTest.php b/tests/Configuration/SystemConfigurationTest.php index d18c42ca..f2460ef6 100644 --- a/tests/Configuration/SystemConfigurationTest.php +++ b/tests/Configuration/SystemConfigurationTest.php @@ -163,15 +163,6 @@ class SystemConfigurationTest extends TestCase $this->assertEquals('2020-03-27', $sut->getFinancialYearStart()); } - public function testOffsetUnsetThrowsException(): void - { - $this->expectException(\BadMethodCallException::class); - $this->expectExceptionMessage('SystemBundleConfiguration does not support offsetUnset()'); - - $sut = $this->getSut($this->getDefaultSettings(), []); - $sut->offsetUnset('dfsdf'); - } - public function testUnknownConfigs(): void { $sut = $this->getSut($this->getDefaultSettings(), [ diff --git a/tests/Controller/Auth/SamlControllerTest.php b/tests/Controller/Auth/SamlControllerTest.php index 621b460f..36e2ab26 100644 --- a/tests/Controller/Auth/SamlControllerTest.php +++ b/tests/Controller/Auth/SamlControllerTest.php @@ -18,11 +18,11 @@ use App\Tests\Mocks\Saml\SamlAuthFactoryFactory; use App\Tests\Mocks\SystemConfigurationFactory; use OneLogin\Saml2\Auth; use PHPUnit\Framework\TestCase; -use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Security\Http\SecurityRequestAttributes; /** * @group integration @@ -127,7 +127,7 @@ class SamlControllerTest extends TestCase $request = new Request(); $request->setSession($this->createMock(SessionInterface::class)); - $request->attributes->set(Security::AUTHENTICATION_ERROR, new \Exception('My test error')); + $request->attributes->set(SecurityRequestAttributes::AUTHENTICATION_ERROR, new \Exception('My test error')); $factory = $this->getMockBuilder(SamlAuthFactory::class)->disableOriginalConstructor()->getMock(); diff --git a/tests/Entity/InvoiceTemplateTest.php b/tests/Entity/InvoiceTemplateTest.php index e714601e..f57adeaa 100644 --- a/tests/Entity/InvoiceTemplateTest.php +++ b/tests/Entity/InvoiceTemplateTest.php @@ -35,7 +35,6 @@ class InvoiceTemplateTest extends TestCase self::assertEquals('default', $sut->getNumberGenerator()); self::assertEquals('default', $sut->getRenderer()); self::assertEquals(30, $sut->getDueDays()); - self::assertTrue($sut->isDecimalDuration()); } public function testSetNullForOptionalValues(): void diff --git a/tests/Export/Spreadsheet/CellFormatter/AbstractFormatterTest.php b/tests/Export/Spreadsheet/CellFormatter/AbstractFormatterTest.php index f331d8cc..2a512359 100644 --- a/tests/Export/Spreadsheet/CellFormatter/AbstractFormatterTest.php +++ b/tests/Export/Spreadsheet/CellFormatter/AbstractFormatterTest.php @@ -11,6 +11,7 @@ namespace App\Tests\Export\Spreadsheet\CellFormatter; use App\Export\Spreadsheet\CellFormatter\CellFormatterInterface; use PhpOffice\PhpSpreadsheet\Cell\Cell; +use PhpOffice\PhpSpreadsheet\Cell\CellAddress; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Style\Style; use PHPUnit\Framework\TestCase; @@ -42,7 +43,7 @@ abstract class AbstractFormatterTest extends TestCase $sut->setFormattedValue($worksheet, 1, 1, $this->getActualValue()); $cell = $worksheet->getCell([1, 1]); $this->assertCellValue($cell); - $this->assertCellStyle($worksheet->getStyleByColumnAndRow(1, 1)); + $this->assertCellStyle($worksheet->getStyle(CellAddress::fromColumnAndRow(1, 1))); } public function testSetNull(): void diff --git a/tests/Export/Spreadsheet/CellFormatter/DateFormatterTest.php b/tests/Export/Spreadsheet/CellFormatter/DateFormatterTest.php index e5cd754b..e5f29a24 100644 --- a/tests/Export/Spreadsheet/CellFormatter/DateFormatterTest.php +++ b/tests/Export/Spreadsheet/CellFormatter/DateFormatterTest.php @@ -52,6 +52,6 @@ class DateFormatterTest extends AbstractFormatterTest public function assertCellStyle(Style $style): void { - self::assertEquals(NumberFormat::FORMAT_DATE_YYYYMMDD2, $style->getNumberFormat()->getFormatCode()); + self::assertEquals(NumberFormat::FORMAT_DATE_YYYYMMDD, $style->getNumberFormat()->getFormatCode()); } } diff --git a/tests/Invoice/Hydrator/InvoiceItemDefaultHydratorTest.php b/tests/Invoice/Hydrator/InvoiceItemDefaultHydratorTest.php index bde73220..7afb2f31 100644 --- a/tests/Invoice/Hydrator/InvoiceItemDefaultHydratorTest.php +++ b/tests/Invoice/Hydrator/InvoiceItemDefaultHydratorTest.php @@ -63,6 +63,7 @@ class InvoiceItemDefaultHydratorTest extends TestCase 'entry.end_time', 'entry.end_timestamp', 'entry.date', + 'entry.date_process', 'entry.week', 'entry.weekyear', 'entry.user_id', diff --git a/tests/Invoice/Hydrator/InvoiceModelActivityHydratorTest.php b/tests/Invoice/Hydrator/InvoiceModelActivityHydratorTest.php index f1b03dbd..18187eba 100644 --- a/tests/Invoice/Hydrator/InvoiceModelActivityHydratorTest.php +++ b/tests/Invoice/Hydrator/InvoiceModelActivityHydratorTest.php @@ -37,6 +37,8 @@ class InvoiceModelActivityHydratorTest extends TestCase 'activity.id', 'activity.name', 'activity.comment', + 'activity.number', + 'activity.invoice_text', 'activity.meta.foo-activity', 'activity.budget_open', 'activity.budget_open_plain', @@ -45,6 +47,8 @@ class InvoiceModelActivityHydratorTest extends TestCase 'activity.1.id', 'activity.1.name', 'activity.1.comment', + 'activity.1.number', + 'activity.1.invoice_text', 'activity.1.meta.foo-activity', 'activity.1.budget_open', 'activity.1.budget_open_plain', diff --git a/tests/Invoice/Hydrator/InvoiceModelProjectHydratorTest.php b/tests/Invoice/Hydrator/InvoiceModelProjectHydratorTest.php index 09c09329..d0c9104d 100644 --- a/tests/Invoice/Hydrator/InvoiceModelProjectHydratorTest.php +++ b/tests/Invoice/Hydrator/InvoiceModelProjectHydratorTest.php @@ -37,6 +37,8 @@ class InvoiceModelProjectHydratorTest extends TestCase 'project.id', 'project.name', 'project.comment', + 'project.number', + 'project.invoice_text', 'project.order_date', 'project.order_number', 'project.meta.foo-project', @@ -55,6 +57,8 @@ class InvoiceModelProjectHydratorTest extends TestCase 'project.1.id', 'project.1.name', 'project.1.comment', + 'project.1.number', + 'project.1.invoice_text', 'project.1.order_date', 'project.1.order_number', 'project.1.meta.foo-project', diff --git a/tests/Invoice/Renderer/DebugRendererTest.php b/tests/Invoice/Renderer/DebugRendererTest.php index a35755c5..e04fcf3d 100644 --- a/tests/Invoice/Renderer/DebugRendererTest.php +++ b/tests/Invoice/Renderer/DebugRendererTest.php @@ -152,6 +152,8 @@ class DebugRendererTest extends TestCase 'activity.id', 'activity.name', 'activity.comment', + 'activity.number', + 'activity.invoice_text', 'activity.meta.foo-activity', 'activity.budget_open', 'activity.budget_open_plain', @@ -184,6 +186,8 @@ class DebugRendererTest extends TestCase 'activity.1.id', 'activity.1.name', 'activity.1.comment', + 'activity.1.number', + 'activity.1.invoice_text', 'activity.1.meta.foo-activity', ]); } @@ -201,6 +205,8 @@ class DebugRendererTest extends TestCase 'project.id', 'project.name', 'project.comment', + 'project.number', + 'project.invoice_text', 'project.order_date', 'project.order_number', 'project.meta.foo-project', @@ -223,6 +229,8 @@ class DebugRendererTest extends TestCase 'project.1.id', 'project.1.name', 'project.1.comment', + 'project.1.number', + 'project.1.invoice_text', 'project.1.order_date', 'project.1.order_number', 'project.1.meta.foo-project', @@ -276,6 +284,7 @@ class DebugRendererTest extends TestCase 'entry.end_time', 'entry.end_timestamp', 'entry.date', + 'entry.date_process', 'entry.week', 'entry.weekyear', 'entry.user_id', diff --git a/tests/Invoice/Renderer/PdfRendererTest.php b/tests/Invoice/Renderer/PdfRendererTest.php index 5fd0d8e0..067f3b2c 100644 --- a/tests/Invoice/Renderer/PdfRendererTest.php +++ b/tests/Invoice/Renderer/PdfRendererTest.php @@ -116,9 +116,9 @@ class PdfRendererTest extends KernelTestCase $dirs = [ __DIR__ . '/../../../templates/invoice/renderer/', - __DIR__ . '/../../../var/invoices/', - __DIR__ . '/../../../var/invoices_customer/', - __DIR__ . '/../../../var/invoices_old/', + //__DIR__ . '/../../../var/invoices/', + //__DIR__ . '/../../../var/invoices_customer/', + //__DIR__ . '/../../../var/invoices_old/', ]; $files = []; diff --git a/tests/Invoice/ServiceInvoiceTest.php b/tests/Invoice/ServiceInvoiceTest.php index bb5ebc28..2801a3af 100644 --- a/tests/Invoice/ServiceInvoiceTest.php +++ b/tests/Invoice/ServiceInvoiceTest.php @@ -200,8 +200,8 @@ class ServiceInvoiceTest extends TestCase self::assertNotNull($query->getBegin()); self::assertNotNull($query->getEnd()); - self::assertEquals('2010-01-27T00:00:00+0100', $query->getBegin()->format(DATE_ISO8601)); - self::assertEquals('2020-11-27T23:59:59+0100', $query->getEnd()->format(DATE_ISO8601)); + self::assertEquals('2010-01-27T00:00:00+01:00', $query->getBegin()->format(DATE_ATOM)); + self::assertEquals('2020-11-27T23:59:59+01:00', $query->getEnd()->format(DATE_ATOM)); } public function testCreateModelsIncludesModelsWithNegativeTotal(): void diff --git a/tests/Twig/LocaleFormatExtensionsTest.php b/tests/Twig/LocaleFormatExtensionsTest.php index 281877c2..3866ed77 100644 --- a/tests/Twig/LocaleFormatExtensionsTest.php +++ b/tests/Twig/LocaleFormatExtensionsTest.php @@ -271,7 +271,7 @@ class LocaleFormatExtensionsTest extends TestCase $user->setTimezone('Asia/Dubai'); $date = $sut->createDate('2019-08-27 16:30:45', $user); - $this->assertEquals('2019-08-27T16:30:45+0400', $date->format(DATE_ISO8601)); + $this->assertEquals('2019-08-27T16:30:45+04:00', $date->format(DATE_ATOM)); $this->assertEquals('Asia/Dubai', $date->getTimezone()->getName()); $date = $sut->createDate('2019-08-27 16:30:45', null); diff --git a/tests/Widget/Type/DailyWorkingTimeChartTest.php b/tests/Widget/Type/DailyWorkingTimeChartTest.php index f3696cd6..c4cb7bae 100644 --- a/tests/Widget/Type/DailyWorkingTimeChartTest.php +++ b/tests/Widget/Type/DailyWorkingTimeChartTest.php @@ -9,11 +9,8 @@ namespace App\Tests\Widget\Type; -use App\Entity\Activity; -use App\Entity\Project; use App\Entity\User; -use App\Model\Statistic\Day; -use App\Widget\DataProvider\DailyWorkingTimeChartProvider; +use App\Repository\TimesheetRepository; use App\Widget\Type\DailyWorkingTimeChart; use App\Widget\WidgetInterface; use PHPUnit\Framework\TestCase; @@ -27,7 +24,7 @@ class DailyWorkingTimeChartTest extends TestCase { public function createSut(): DailyWorkingTimeChart { - $repository = $this->createMock(DailyWorkingTimeChartProvider::class); + $repository = $this->createMock(TimesheetRepository::class); $sut = new DailyWorkingTimeChart($repository); $sut->setUser(new User()); @@ -65,54 +62,4 @@ class DailyWorkingTimeChartTest extends TestCase self::assertStringStartsWith('DailyWorkingTimeChart_', $options['id']); self::assertEquals('xxx', $options['type']); } - - public function testGetData(): void - { - $activity = $this->createMock(Activity::class); - $activity->method('getId')->willReturn(42); - - $project = $this->createMock(Project::class); - $project->method('getId')->willReturn(4711); - - $repository = $this->getMockBuilder(DailyWorkingTimeChartProvider::class)->disableOriginalConstructor()->onlyMethods(['getDailyData'])->getMock(); - $repository->expects($this->once())->method('getDailyData')->willReturnCallback(function ($begin, $end, $user) use ($activity, $project) { - return [ - [ - 'year' => $begin->format('Y'), - 'month' => $begin->format('n'), - 'day' => $begin->format('j'), - 'rate' => 13.75, - 'duration' => 1234, - 'billable' => 1234, - 'details' => [ - [ - 'activity' => $activity, - 'project' => $project, - 'billable' => 1234, - ] - ] - ] - ]; - }); - - $sut = new DailyWorkingTimeChart($repository); - $sut->setUser(new User()); - $data = $sut->getData($sut->getOptions()); - self::assertCount(2, $data); - self::assertArrayHasKey('activities', $data); - self::assertArrayHasKey('data', $data); - - self::assertCount(1, $data['activities']); - self::assertArrayHasKey('4711_42', $data['activities']); - self::assertCount(2, $data['activities']['4711_42']); - self::assertArrayHasKey('activity', $data['activities']['4711_42']); - self::assertArrayHasKey('project', $data['activities']['4711_42']); - self::assertSame($activity, $data['activities']['4711_42']['activity']); - self::assertSame($project, $data['activities']['4711_42']['project']); - - self::assertCount(7, $data['data']); - foreach ($data['data'] as $statObj) { - self::assertInstanceOf(Day::class, $statObj); - } - } } diff --git a/tests/phpstan.neon b/tests/phpstan.neon index d08a4de2..7d155305 100644 --- a/tests/phpstan.neon +++ b/tests/phpstan.neon @@ -5,6 +5,7 @@ includes: - %rootDir%/../phpstan-doctrine/rules.neon - %rootDir%/../phpstan-phpunit/extension.neon - %rootDir%/../phpstan-phpunit/rules.neon + - %rootDir%/../phpstan-deprecation-rules/rules.neon parameters: level: 9 @@ -4132,16 +4133,6 @@ parameters: count: 1 path: Widget/Type/AmountYearTest.php - - - message: "#^Parameter \\#2 \\$array of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) expects array\\|ArrayAccess, mixed given\\.$#" - count: 1 - path: Widget/Type/DailyWorkingTimeChartTest.php - - - - message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertCount\\(\\) expects Countable\\|iterable, mixed given\\.$#" - count: 1 - path: Widget/Type/DailyWorkingTimeChartTest.php - - message: "#^Method App\\\\Tests\\\\Widget\\\\Type\\\\DurationYearTest\\:\\:getDefaultOptions\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 diff --git a/translations/messages.de.xlf b/translations/messages.de.xlf index 7a71b6b4..cb781884 100644 --- a/translations/messages.de.xlf +++ b/translations/messages.de.xlf @@ -1544,10 +1544,18 @@
|---|