From ff6a3e826282a831152eaa60327653fabf76c836 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Sun, 4 Aug 2024 18:22:27 +0200 Subject: [PATCH] Release 2.20.0 (#4987) --- .docker/000-default.conf | 1 - .github/release-drafter.yml | 2 - composer.json | 1 - composer.lock | 388 +++++++++--------- config/packages/nelmio_api_doc.yaml | 4 +- config/packages/tabler.yaml | 1 - phpstan.neon | 42 +- .../AbstractBundleInstallerCommand.php | 12 +- src/Command/ActivateUserCommand.php | 4 +- src/Command/ChangePasswordCommand.php | 2 +- src/Command/CreateUserCommand.php | 2 +- src/Command/DeactivateUserCommand.php | 4 +- src/Command/DemoteUserCommand.php | 8 +- src/Command/ExportCreateCommand.php | 22 +- src/Command/InstallCommand.php | 8 +- src/Command/InvoiceCreateCommand.php | 16 +- src/Command/PromoteUserCommand.php | 8 +- src/Command/RegenerateLocalesCommand.php | 2 +- src/Command/ReloadCommand.php | 2 +- src/Command/TimesheetStopAllCommand.php | 2 +- src/Command/TranslationCommand.php | 12 +- src/Command/UpdateCommand.php | 4 +- src/Command/VersionCommand.php | 2 +- src/Configuration/LocaleService.php | 4 +- src/ConsoleApplication.php | 2 +- src/Constants.php | 4 +- src/Controller/BookmarkController.php | 2 +- src/Controller/DoctorController.php | 4 +- src/Controller/InvoiceController.php | 2 +- src/Controller/PermissionController.php | 2 +- src/Controller/QuickEntryController.php | 2 +- .../Security/PasswordResetController.php | 2 +- .../Security/SelfRegistrationController.php | 2 +- src/Controller/TeamController.php | 2 +- .../TimesheetAbstractController.php | 4 +- src/DependencyInjection/AppExtension.php | 2 +- src/Entity/ActivityMeta.php | 2 +- src/Entity/CustomerMeta.php | 2 +- src/Entity/InvoiceMeta.php | 2 +- src/Entity/ProjectMeta.php | 2 +- src/Entity/Timesheet.php | 2 +- src/Entity/TimesheetMeta.php | 2 +- src/Export/Annotation/Expose.php | 2 +- .../Base/AbstractSpreadsheetRenderer.php | 10 +- src/Export/Base/CsvRenderer.php | 2 +- src/Export/ServiceExport.php | 2 +- .../CellFormatter/DurationFormatter.php | 2 +- .../Extractor/AnnotationExtractor.php | 16 +- src/Form/Type/ColorPickerType.php | 2 +- src/Form/Type/DateRangeType.php | 9 +- src/Form/Type/DurationType.php | 3 +- src/Form/Type/UserLocaleType.php | 2 +- src/Invoice/ServiceInvoice.php | 8 +- src/Kernel.php | 4 +- src/Ldap/LdapAuthenticator.php | 2 +- src/Ldap/LdapCredentialsSubscriber.php | 2 +- src/Ldap/LdapManager.php | 10 +- src/Ldap/LdapUserProvider.php | 8 +- src/Model/Statistic/Month.php | 2 +- src/Plugin/PluginMetadata.php | 14 +- src/Repository/RepositorySearchTrait.php | 4 +- src/Saml/SamlAuthenticator.php | 2 +- src/Saml/SamlLoginAttributes.php | 2 +- src/Saml/SamlProvider.php | 2 +- src/Twig/LocaleFormatExtensions.php | 2 +- src/Twig/Runtime/WidgetExtension.php | 2 +- src/Twig/SecurityPolicy/ForbiddenPolicy.php | 10 +- src/User/UserService.php | 2 +- src/Utils/Color.php | 2 +- src/Utils/Duration.php | 8 +- src/Utils/FileHelper.php | 4 +- src/Utils/PaginationTemplate.php | 6 +- src/Widget/Type/AbstractWidget.php | 2 +- src/Widget/Type/PaginatedWorkingTimeChart.php | 4 +- src/Widget/WidgetService.php | 2 +- tests/API/APIControllerBaseTest.php | 30 +- tests/API/ActionsControllerTest.php | 16 +- tests/API/ActivityControllerTest.php | 4 +- tests/API/ApiDocControllerTest.php | 6 +- tests/API/AuthenticationTest.php | 4 +- tests/API/CustomerControllerTest.php | 4 +- tests/API/ProjectControllerTest.php | 4 +- tests/API/TimesheetControllerTest.php | 2 +- tests/Command/ExportCreateCommandTest.php | 4 +- tests/Command/UpdateCommandTest.php | 2 +- tests/ConsoleApplicationTest.php | 2 +- tests/Controller/ControllerBaseTest.php | 10 +- tests/Controller/ProfileControllerTest.php | 2 +- .../AbstractUserPeriodControllerTest.php | 8 +- .../AbstractUsersPeriodControllerTest.php | 10 +- tests/Entity/EntityValidationTestTrait.php | 6 +- .../ConfigurableNumberGeneratorTest.php | 2 +- tests/Ldap/LdapManagerTest.php | 8 +- tests/Model/MonthTest.php | 4 +- tests/Model/YearTest.php | 4 +- tests/TranslationsTest.php | 6 +- tests/Utils/FormFormatConverterTest.php | 2 +- tests/Voter/CustomerVoterTest.php | 2 +- tests/Voter/ProjectVoterTest.php | 2 +- tests/Voter/RolePermissionVoterTest.php | 2 +- tests/WorkingTime/Model/MonthTest.php | 4 +- 101 files changed, 441 insertions(+), 458 deletions(-) diff --git a/.docker/000-default.conf b/.docker/000-default.conf index 5702d89a..fb8f28c8 100644 --- a/.docker/000-default.conf +++ b/.docker/000-default.conf @@ -2,7 +2,6 @@ ServerAdmin webmaster@localhost DocumentRoot /opt/kimai/public - PassEnv DATABASE_PREFIX PassEnv MAILER_FROM PassEnv APP_ENV PassEnv APP_SECRET diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index f6f08e08..56d42f92 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -21,8 +21,6 @@ version-resolver: - 'translation' default: patch template: | - [Upgrade Kimai](https://www.kimai.org/documentation/updates.html) - [Install Kimai](https://www.kimai.org/documentation/installation.html) - [Docker](https://www.kimai.org/documentation/docker.html) - **Compatible with PHP 8.1 to 8.3** $CHANGES diff --git a/composer.json b/composer.json index 0368124a..f0437077 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,6 @@ "symfony/security-bundle": "^6.0", "symfony/security-csrf": "^6.0", "symfony/serializer": "^6.0", - "symfony/string": "v6.4.8", "symfony/translation": "^6.0", "symfony/twig-bundle": "^6.0", "symfony/validator": "^6.0", diff --git a/composer.lock b/composer.lock index ba85653f..803a9422 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": "10cf37b50382111d234550eb4be183c9", + "content-hash": "460fdc53c1097fb2ef3c333529deb502", "packages": [ { "name": "azuyalabs/yasumi", @@ -3115,16 +3115,16 @@ }, { "name": "nelmio/api-doc-bundle", - "version": "v4.28.0", + "version": "v4.29.0", "source": { "type": "git", "url": "https://github.com/nelmio/NelmioApiDocBundle.git", - "reference": "684391a5fab4bdfac752560d3483d0f7109448a5" + "reference": "c9523906023e61351f03dbab8d077173f5ec4883" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/684391a5fab4bdfac752560d3483d0f7109448a5", - "reference": "684391a5fab4bdfac752560d3483d0f7109448a5", + "url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/c9523906023e61351f03dbab8d077173f5ec4883", + "reference": "c9523906023e61351f03dbab8d077173f5ec4883", "shasum": "" }, "require": { @@ -3225,9 +3225,15 @@ ], "support": { "issues": "https://github.com/nelmio/NelmioApiDocBundle/issues", - "source": "https://github.com/nelmio/NelmioApiDocBundle/tree/v4.28.0" + "source": "https://github.com/nelmio/NelmioApiDocBundle/tree/v4.29.0" }, - "time": "2024-06-19T14:37:45+00:00" + "funding": [ + { + "url": "https://github.com/DjordyKoert", + "type": "github" + } + ], + "time": "2024-07-22T08:40:00+00:00" }, { "name": "nelmio/cors-bundle", @@ -4960,16 +4966,16 @@ }, { "name": "symfony/cache", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "287142df5579ce223c485b3872df3efae8390984" + "reference": "6702d2d777260e6ff3451fee2d7d78ab5f715cdc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/287142df5579ce223c485b3872df3efae8390984", - "reference": "287142df5579ce223c485b3872df3efae8390984", + "url": "https://api.github.com/repos/symfony/cache/zipball/6702d2d777260e6ff3451fee2d7d78ab5f715cdc", + "reference": "6702d2d777260e6ff3451fee2d7d78ab5f715cdc", "shasum": "" }, "require": { @@ -5036,7 +5042,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.4.8" + "source": "https://github.com/symfony/cache/tree/v6.4.10" }, "funding": [ { @@ -5052,7 +5058,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-17T06:05:49+00:00" }, { "name": "symfony/cache-contracts", @@ -5281,16 +5287,16 @@ }, { "name": "symfony/console", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9" + "reference": "504974cbe43d05f83b201d6498c206f16fc0cdbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", - "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", + "url": "https://api.github.com/repos/symfony/console/zipball/504974cbe43d05f83b201d6498c206f16fc0cdbc", + "reference": "504974cbe43d05f83b201d6498c206f16fc0cdbc", "shasum": "" }, "require": { @@ -5355,7 +5361,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.9" + "source": "https://github.com/symfony/console/tree/v6.4.10" }, "funding": [ { @@ -5371,7 +5377,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:49:33+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "symfony/css-selector", @@ -5440,16 +5446,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "a4df9dfe5da2d177af6643610c7bee2cb76a9f5e" + "reference": "5caf9c5f6085f13b27d70a236b776c07e4a1c3eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/a4df9dfe5da2d177af6643610c7bee2cb76a9f5e", - "reference": "a4df9dfe5da2d177af6643610c7bee2cb76a9f5e", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/5caf9c5f6085f13b27d70a236b776c07e4a1c3eb", + "reference": "5caf9c5f6085f13b27d70a236b776c07e4a1c3eb", "shasum": "" }, "require": { @@ -5501,7 +5507,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.4.9" + "source": "https://github.com/symfony/dependency-injection/tree/v6.4.10" }, "funding": [ { @@ -5517,7 +5523,7 @@ "type": "tidelift" } ], - "time": "2024-06-19T10:45:28+00:00" + "time": "2024-07-26T07:32:07+00:00" }, { "name": "symfony/deprecation-contracts", @@ -5588,16 +5594,16 @@ }, { "name": "symfony/doctrine-bridge", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "64d024fcb3aa613fe163ecae4aaa836dd6d1c5cd" + "reference": "0de9662441bce4670506d0c371cc819a9d0a7607" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/64d024fcb3aa613fe163ecae4aaa836dd6d1c5cd", - "reference": "64d024fcb3aa613fe163ecae4aaa836dd6d1c5cd", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/0de9662441bce4670506d0c371cc819a9d0a7607", + "reference": "0de9662441bce4670506d0c371cc819a9d0a7607", "shasum": "" }, "require": { @@ -5676,7 +5682,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v6.4.9" + "source": "https://github.com/symfony/doctrine-bridge/tree/v6.4.10" }, "funding": [ { @@ -5692,20 +5698,20 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:25:38+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "symfony/dotenv", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/dotenv.git", - "reference": "55aefa0029adff89ecffdb560820e945c7983f06" + "reference": "2ae0c84cc9be0dc1eeb86016970b63c764d8472e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/55aefa0029adff89ecffdb560820e945c7983f06", - "reference": "55aefa0029adff89ecffdb560820e945c7983f06", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/2ae0c84cc9be0dc1eeb86016970b63c764d8472e", + "reference": "2ae0c84cc9be0dc1eeb86016970b63c764d8472e", "shasum": "" }, "require": { @@ -5750,7 +5756,7 @@ "environment" ], "support": { - "source": "https://github.com/symfony/dotenv/tree/v6.4.8" + "source": "https://github.com/symfony/dotenv/tree/v6.4.10" }, "funding": [ { @@ -5766,20 +5772,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-09T18:29:35+00:00" }, { "name": "symfony/error-handler", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "c9b7cc075b3ab484239855622ca05cb0b99c13ec" + "reference": "231f1b2ee80f72daa1972f7340297d67439224f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/c9b7cc075b3ab484239855622ca05cb0b99c13ec", - "reference": "c9b7cc075b3ab484239855622ca05cb0b99c13ec", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/231f1b2ee80f72daa1972f7340297d67439224f0", + "reference": "231f1b2ee80f72daa1972f7340297d67439224f0", "shasum": "" }, "require": { @@ -5825,7 +5831,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.4.9" + "source": "https://github.com/symfony/error-handler/tree/v6.4.10" }, "funding": [ { @@ -5841,7 +5847,7 @@ "type": "tidelift" } ], - "time": "2024-06-21T16:04:15+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "symfony/event-dispatcher", @@ -6131,16 +6137,16 @@ }, { "name": "symfony/finder", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3ef977a43883215d560a2cecb82ec8e62131471c" + "reference": "af29198d87112bebdd397bd7735fbd115997824c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3ef977a43883215d560a2cecb82ec8e62131471c", - "reference": "3ef977a43883215d560a2cecb82ec8e62131471c", + "url": "https://api.github.com/repos/symfony/finder/zipball/af29198d87112bebdd397bd7735fbd115997824c", + "reference": "af29198d87112bebdd397bd7735fbd115997824c", "shasum": "" }, "require": { @@ -6175,7 +6181,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.4.8" + "source": "https://github.com/symfony/finder/tree/v6.4.10" }, "funding": [ { @@ -6191,20 +6197,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-24T07:06:38+00:00" }, { "name": "symfony/flex", - "version": "v2.4.5", + "version": "v2.4.6", "source": { "type": "git", "url": "https://github.com/symfony/flex.git", - "reference": "b0a405f40614c9f584b489d54f91091817b0e26e" + "reference": "4dc11919791f81d087a12db2ab4c7e044431ef6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/flex/zipball/b0a405f40614c9f584b489d54f91091817b0e26e", - "reference": "b0a405f40614c9f584b489d54f91091817b0e26e", + "url": "https://api.github.com/repos/symfony/flex/zipball/4dc11919791f81d087a12db2ab4c7e044431ef6b", + "reference": "4dc11919791f81d087a12db2ab4c7e044431ef6b", "shasum": "" }, "require": { @@ -6240,7 +6246,7 @@ "description": "Composer plugin for Symfony", "support": { "issues": "https://github.com/symfony/flex/issues", - "source": "https://github.com/symfony/flex/tree/v2.4.5" + "source": "https://github.com/symfony/flex/tree/v2.4.6" }, "funding": [ { @@ -6256,20 +6262,20 @@ "type": "tidelift" } ], - "time": "2024-03-02T08:16:47+00:00" + "time": "2024-04-27T10:22:22+00:00" }, { "name": "symfony/form", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "196ebc738e59bec2bbf1f49c24cc221b47f77f5d" + "reference": "67dd6a3fd986cae9a90a8c2c526464c06f525863" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/196ebc738e59bec2bbf1f49c24cc221b47f77f5d", - "reference": "196ebc738e59bec2bbf1f49c24cc221b47f77f5d", + "url": "https://api.github.com/repos/symfony/form/zipball/67dd6a3fd986cae9a90a8c2c526464c06f525863", + "reference": "67dd6a3fd986cae9a90a8c2c526464c06f525863", "shasum": "" }, "require": { @@ -6337,7 +6343,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v6.4.8" + "source": "https://github.com/symfony/form/tree/v6.4.10" }, "funding": [ { @@ -6353,20 +6359,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-19T08:21:35+00:00" }, { "name": "symfony/framework-bundle", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "c1d1cb0e508e11639283e1e6f8918eef0fa524bd" + "reference": "6cbdb0cc3ddbb63499262cd3036882b08ee2690b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/c1d1cb0e508e11639283e1e6f8918eef0fa524bd", - "reference": "c1d1cb0e508e11639283e1e6f8918eef0fa524bd", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/6cbdb0cc3ddbb63499262cd3036882b08ee2690b", + "reference": "6cbdb0cc3ddbb63499262cd3036882b08ee2690b", "shasum": "" }, "require": { @@ -6485,7 +6491,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v6.4.9" + "source": "https://github.com/symfony/framework-bundle/tree/v6.4.10" }, "funding": [ { @@ -6501,20 +6507,20 @@ "type": "tidelift" } ], - "time": "2024-06-26T08:32:27+00:00" + "time": "2024-07-26T13:24:20+00:00" }, { "name": "symfony/http-client", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "6e9db0025db565bcf8f1d46ed734b549e51e6045" + "reference": "b5e498f763e0bf5eed8dcd946e50a3b3f71d4ded" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/6e9db0025db565bcf8f1d46ed734b549e51e6045", - "reference": "6e9db0025db565bcf8f1d46ed734b549e51e6045", + "url": "https://api.github.com/repos/symfony/http-client/zipball/b5e498f763e0bf5eed8dcd946e50a3b3f71d4ded", + "reference": "b5e498f763e0bf5eed8dcd946e50a3b3f71d4ded", "shasum": "" }, "require": { @@ -6578,7 +6584,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.9" + "source": "https://github.com/symfony/http-client/tree/v6.4.10" }, "funding": [ { @@ -6594,7 +6600,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T07:59:05+00:00" + "time": "2024-07-15T09:26:24+00:00" }, { "name": "symfony/http-client-contracts", @@ -6676,16 +6682,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "27de8cc95e11db7a50b027e71caaab9024545947" + "reference": "117f1f20a7ade7bcea28b861fb79160a21a1e37b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/27de8cc95e11db7a50b027e71caaab9024545947", - "reference": "27de8cc95e11db7a50b027e71caaab9024545947", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/117f1f20a7ade7bcea28b861fb79160a21a1e37b", + "reference": "117f1f20a7ade7bcea28b861fb79160a21a1e37b", "shasum": "" }, "require": { @@ -6733,7 +6739,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.8" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.10" }, "funding": [ { @@ -6749,20 +6755,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-26T12:36:27+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "cc4a9bec6e1bdd2405f40277a68a6ed1bb393005" + "reference": "147e0daf618d7575b5007055340d09aece5cf068" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/cc4a9bec6e1bdd2405f40277a68a6ed1bb393005", - "reference": "cc4a9bec6e1bdd2405f40277a68a6ed1bb393005", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/147e0daf618d7575b5007055340d09aece5cf068", + "reference": "147e0daf618d7575b5007055340d09aece5cf068", "shasum": "" }, "require": { @@ -6847,7 +6853,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.9" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.10" }, "funding": [ { @@ -6863,7 +6869,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T11:48:06+00:00" + "time": "2024-07-26T14:52:04+00:00" }, { "name": "symfony/intl", @@ -7894,16 +7900,16 @@ }, { "name": "symfony/property-info", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "1a0357ed93a6ab09482435a7818defaa85cad69b" + "reference": "edaea9dcc723cb4a0ab6a00f7d6f8c07c0d8ff77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/1a0357ed93a6ab09482435a7818defaa85cad69b", - "reference": "1a0357ed93a6ab09482435a7818defaa85cad69b", + "url": "https://api.github.com/repos/symfony/property-info/zipball/edaea9dcc723cb4a0ab6a00f7d6f8c07c0d8ff77", + "reference": "edaea9dcc723cb4a0ab6a00f7d6f8c07c0d8ff77", "shasum": "" }, "require": { @@ -7957,7 +7963,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v6.4.9" + "source": "https://github.com/symfony/property-info/tree/v6.4.10" }, "funding": [ { @@ -7973,7 +7979,7 @@ "type": "tidelift" } ], - "time": "2024-06-21T16:04:15+00:00" + "time": "2024-07-26T07:32:07+00:00" }, { "name": "symfony/rate-limiter", @@ -8048,16 +8054,16 @@ }, { "name": "symfony/routing", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "8a40d0f9b01f0fbb80885d3ce0ad6714fb603a58" + "reference": "aad19fe10753ba842f0d653a8db819c4b3affa87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/8a40d0f9b01f0fbb80885d3ce0ad6714fb603a58", - "reference": "8a40d0f9b01f0fbb80885d3ce0ad6714fb603a58", + "url": "https://api.github.com/repos/symfony/routing/zipball/aad19fe10753ba842f0d653a8db819c4b3affa87", + "reference": "aad19fe10753ba842f0d653a8db819c4b3affa87", "shasum": "" }, "require": { @@ -8111,7 +8117,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.4.8" + "source": "https://github.com/symfony/routing/tree/v6.4.10" }, "funding": [ { @@ -8127,7 +8133,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-15T09:26:24+00:00" }, { "name": "symfony/runtime", @@ -8210,16 +8216,16 @@ }, { "name": "symfony/security-bundle", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "adc34df2fe487a13d4410a237202422294c917b2" + "reference": "50007f4f76632741b62fa9604c5f65807f268b72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/adc34df2fe487a13d4410a237202422294c917b2", - "reference": "adc34df2fe487a13d4410a237202422294c917b2", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/50007f4f76632741b62fa9604c5f65807f268b72", + "reference": "50007f4f76632741b62fa9604c5f65807f268b72", "shasum": "" }, "require": { @@ -8302,7 +8308,7 @@ "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-bundle/tree/v6.4.9" + "source": "https://github.com/symfony/security-bundle/tree/v6.4.10" }, "funding": [ { @@ -8318,20 +8324,20 @@ "type": "tidelift" } ], - "time": "2024-06-28T10:06:43+00:00" + "time": "2024-07-17T10:49:44+00:00" }, { "name": "symfony/security-core", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "2d58f4c3ff50b1b4eef0a333c2b1e3eef46807f4" + "reference": "432dec55da108c471adcf58c351af01372a52164" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/2d58f4c3ff50b1b4eef0a333c2b1e3eef46807f4", - "reference": "2d58f4c3ff50b1b4eef0a333c2b1e3eef46807f4", + "url": "https://api.github.com/repos/symfony/security-core/zipball/432dec55da108c471adcf58c351af01372a52164", + "reference": "432dec55da108c471adcf58c351af01372a52164", "shasum": "" }, "require": { @@ -8388,7 +8394,7 @@ "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v6.4.9" + "source": "https://github.com/symfony/security-core/tree/v6.4.10" }, "funding": [ { @@ -8404,7 +8410,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T07:59:05+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "symfony/security-csrf", @@ -8564,16 +8570,16 @@ }, { "name": "symfony/serializer", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "56ce31d19127e79647ac53387c7555bdcd5730ce" + "reference": "9a67fcf320561e96f94d62bbe0e169ac534a5718" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/56ce31d19127e79647ac53387c7555bdcd5730ce", - "reference": "56ce31d19127e79647ac53387c7555bdcd5730ce", + "url": "https://api.github.com/repos/symfony/serializer/zipball/9a67fcf320561e96f94d62bbe0e169ac534a5718", + "reference": "9a67fcf320561e96f94d62bbe0e169ac534a5718", "shasum": "" }, "require": { @@ -8642,7 +8648,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.4.9" + "source": "https://github.com/symfony/serializer/tree/v6.4.10" }, "funding": [ { @@ -8658,7 +8664,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T07:59:05+00:00" + "time": "2024-07-26T13:13:26+00:00" }, { "name": "symfony/service-contracts", @@ -8807,16 +8813,16 @@ }, { "name": "symfony/string", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a147c0f826c4a1f3afb763ab8e009e37c877a44d" + "reference": "ccf9b30251719567bfd46494138327522b9a9446" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a147c0f826c4a1f3afb763ab8e009e37c877a44d", - "reference": "a147c0f826c4a1f3afb763ab8e009e37c877a44d", + "url": "https://api.github.com/repos/symfony/string/zipball/ccf9b30251719567bfd46494138327522b9a9446", + "reference": "ccf9b30251719567bfd46494138327522b9a9446", "shasum": "" }, "require": { @@ -8873,7 +8879,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.8" + "source": "https://github.com/symfony/string/tree/v6.4.10" }, "funding": [ { @@ -8889,20 +8895,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-22T10:21:14+00:00" }, { "name": "symfony/translation", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "a002933b13989fc4bd0b58e04bf7eec5210e438a" + "reference": "94041203f8ac200ae9e7c6a18fa6137814ccecc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/a002933b13989fc4bd0b58e04bf7eec5210e438a", - "reference": "a002933b13989fc4bd0b58e04bf7eec5210e438a", + "url": "https://api.github.com/repos/symfony/translation/zipball/94041203f8ac200ae9e7c6a18fa6137814ccecc9", + "reference": "94041203f8ac200ae9e7c6a18fa6137814ccecc9", "shasum": "" }, "require": { @@ -8968,7 +8974,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.8" + "source": "https://github.com/symfony/translation/tree/v6.4.10" }, "funding": [ { @@ -8984,7 +8990,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "symfony/translation-contracts", @@ -9259,16 +9265,16 @@ }, { "name": "symfony/validator", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "ee0a4d6a327a963aee094f730da238f7ea18cb01" + "reference": "bcf939a9d1acd7d2912e9474c0c3d7840a03cbcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/ee0a4d6a327a963aee094f730da238f7ea18cb01", - "reference": "ee0a4d6a327a963aee094f730da238f7ea18cb01", + "url": "https://api.github.com/repos/symfony/validator/zipball/bcf939a9d1acd7d2912e9474c0c3d7840a03cbcd", + "reference": "bcf939a9d1acd7d2912e9474c0c3d7840a03cbcd", "shasum": "" }, "require": { @@ -9336,7 +9342,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v6.4.9" + "source": "https://github.com/symfony/validator/tree/v6.4.10" }, "funding": [ { @@ -9352,20 +9358,20 @@ "type": "tidelift" } ], - "time": "2024-06-22T07:42:41+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c31566e4ca944271cc8d8ac6887cbf31b8c6a172" + "reference": "a71cc3374f5fb9759da1961d28c452373b343dd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c31566e4ca944271cc8d8ac6887cbf31b8c6a172", - "reference": "c31566e4ca944271cc8d8ac6887cbf31b8c6a172", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/a71cc3374f5fb9759da1961d28c452373b343dd4", + "reference": "a71cc3374f5fb9759da1961d28c452373b343dd4", "shasum": "" }, "require": { @@ -9421,7 +9427,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.4.9" + "source": "https://github.com/symfony/var-dumper/tree/v6.4.10" }, "funding": [ { @@ -9437,7 +9443,7 @@ "type": "tidelift" } ], - "time": "2024-06-27T13:23:14+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "symfony/var-exporter", @@ -10294,16 +10300,16 @@ }, { "name": "zircote/swagger-php", - "version": "4.10.5", + "version": "4.10.6", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "0840dad40fd6759912485f34bfccf13b49b29226" + "reference": "e462ff5269ea0ec91070edd5d51dc7215bdea3b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/0840dad40fd6759912485f34bfccf13b49b29226", - "reference": "0840dad40fd6759912485f34bfccf13b49b29226", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/e462ff5269ea0ec91070edd5d51dc7215bdea3b6", + "reference": "e462ff5269ea0ec91070edd5d51dc7215bdea3b6", "shasum": "" }, "require": { @@ -10369,9 +10375,9 @@ ], "support": { "issues": "https://github.com/zircote/swagger-php/issues", - "source": "https://github.com/zircote/swagger-php/tree/4.10.5" + "source": "https://github.com/zircote/swagger-php/tree/4.10.6" }, - "time": "2024-07-16T03:13:27+00:00" + "time": "2024-07-26T03:04:43+00:00" } ], "packages-dev": [ @@ -10441,30 +10447,38 @@ }, { "name": "composer/pcre", - "version": "3.1.4", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "04229f163664973f68f38f6f73d917799168ef24" + "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", - "reference": "04229f163664973f68f38f6f73d917799168ef24", + "url": "https://api.github.com/repos/composer/pcre/zipball/ea4ab6f9580a4fd221e0418f2c357cdd39102a90", + "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.8" + }, "require-dev": { - "phpstan/phpstan": "^1.3", + "phpstan/phpstan": "^1.11.8", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { "branch-alias": { "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "autoload": { @@ -10492,7 +10506,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.4" + "source": "https://github.com/composer/pcre/tree/3.2.0" }, "funding": [ { @@ -10508,7 +10522,7 @@ "type": "tidelift" } ], - "time": "2024-05-27T13:40:54+00:00" + "time": "2024-07-25T09:36:02+00:00" }, { "name": "composer/xdebug-handler", @@ -10987,16 +11001,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.59.3", + "version": "v3.61.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29" + "reference": "94a87189f55814e6cabca2d9a33b06de384a2ab8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/94a87189f55814e6cabca2d9a33b06de384a2ab8", + "reference": "94a87189f55814e6cabca2d9a33b06de384a2ab8", "shasum": "" }, "require": { @@ -11078,7 +11092,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.59.3" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.61.1" }, "funding": [ { @@ -11086,7 +11100,7 @@ "type": "github" } ], - "time": "2024-06-16T14:17:03+00:00" + "time": "2024-07-31T14:33:15+00:00" }, { "name": "masterminds/html5", @@ -11333,16 +11347,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.7", + "version": "1.11.9", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d" + "reference": "e370bcddadaede0c1716338b262346f40d296f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/52d2bbfdcae7f895915629e4694e9497d0f8e28d", - "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e370bcddadaede0c1716338b262346f40d296f82", + "reference": "e370bcddadaede0c1716338b262346f40d296f82", "shasum": "" }, "require": { @@ -11387,7 +11401,7 @@ "type": "github" } ], - "time": "2024-07-06T11:17:41+00:00" + "time": "2024-08-01T16:25:18+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -12476,31 +12490,31 @@ }, { "name": "react/socket", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.11", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.3 || ^3.3 || ^2", "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -12544,7 +12558,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.15.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { @@ -12552,7 +12566,7 @@ "type": "open_collective" } ], - "time": "2023-12-15T11:02:10+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", @@ -13806,16 +13820,16 @@ }, { "name": "symfony/phpunit-bridge", - "version": "v6.4.9", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "6e03e4db9696e0cfcda6537177c2c03dc49c45c8" + "reference": "ad510515b11ba5291fdd59b25d70227bfac2d7ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/6e03e4db9696e0cfcda6537177c2c03dc49c45c8", - "reference": "6e03e4db9696e0cfcda6537177c2c03dc49c45c8", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/ad510515b11ba5291fdd59b25d70227bfac2d7ab", + "reference": "ad510515b11ba5291fdd59b25d70227bfac2d7ab", "shasum": "" }, "require": { @@ -13868,7 +13882,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.9" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.10" }, "funding": [ { @@ -13884,7 +13898,7 @@ "type": "tidelift" } ], - "time": "2024-06-21T16:04:15+00:00" + "time": "2024-07-26T12:30:32+00:00" }, { "name": "symfony/process", @@ -13949,16 +13963,16 @@ }, { "name": "symfony/web-profiler-bundle", - "version": "v6.4.8", + "version": "v6.4.10", "source": { "type": "git", "url": "https://github.com/symfony/web-profiler-bundle.git", - "reference": "bcc806d1360991de3bf78ac5ca0202db85de9bfc" + "reference": "370c9f1e3567cd4670d44311838e37d16182c3a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/bcc806d1360991de3bf78ac5ca0202db85de9bfc", - "reference": "bcc806d1360991de3bf78ac5ca0202db85de9bfc", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/370c9f1e3567cd4670d44311838e37d16182c3a7", + "reference": "370c9f1e3567cd4670d44311838e37d16182c3a7", "shasum": "" }, "require": { @@ -14011,7 +14025,7 @@ "dev" ], "support": { - "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.4.8" + "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.4.10" }, "funding": [ { @@ -14027,7 +14041,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-07-19T07:26:48+00:00" }, { "name": "theseer/tokenizer", diff --git a/config/packages/nelmio_api_doc.yaml b/config/packages/nelmio_api_doc.yaml index 7bdafee9..4c2d6a0e 100644 --- a/config/packages/nelmio_api_doc.yaml +++ b/config/packages/nelmio_api_doc.yaml @@ -45,9 +45,9 @@ nelmio_api_doc: - ^/api(?!/doc) documentation: info: - title: Kimai - API Docs + title: Kimai - API description: | - JSON API for the Kimai time-tracking software: [API documentation](https://www.kimai.org/documentation/rest-api.html), [Swagger definition file](doc.json) + JSON API for the Kimai time-tracking software. Read our [API documentation](https://www.kimai.org/documentation/rest-api.html) and download the [Open API definition](doc.json) to import into your API client. version: '1.0' components: securitySchemes: diff --git a/config/packages/tabler.yaml b/config/packages/tabler.yaml index f1d3c3b5..02ceda13 100644 --- a/config/packages/tabler.yaml +++ b/config/packages/tabler.yaml @@ -29,7 +29,6 @@ tabler: routes: tabler_welcome: dashboard tabler_login: login - tabler_logout: logout tabler_login_check: security_check tabler_registration: registration_register tabler_registration_register: registration_register diff --git a/phpstan.neon b/phpstan.neon index 0c919736..87745b7a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -278,11 +278,6 @@ parameters: count: 1 path: src/Command/DemoteUserCommand.php - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: src/Command/ExportCreateCommand.php - - message: "#^Binary operation \"\\.\" between non\\-falsy\\-string and non\\-empty\\-list\\\\|string results in an error\\.$#" count: 2 @@ -345,12 +340,7 @@ parameters: - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 5 - path: src/Command/ExportCreateCommand.php - - - - message: "#^Parameter \\#1 \\.\\.\\.\\$addresses of method Symfony\\\\Component\\\\Mime\\\\Email\\:\\:addTo\\(\\) expects string\\|Symfony\\\\Component\\\\Mime\\\\Address, mixed given\\.$#" - count: 1 + count: 4 path: src/Command/ExportCreateCommand.php - @@ -3268,36 +3258,6 @@ parameters: count: 1 path: src/Form/Type/CustomerType.php - - - message: "#^Parameter \\#1 \\$inputTimezone of class Symfony\\\\Component\\\\Form\\\\Extension\\\\Core\\\\DataTransformer\\\\DateTimeToLocalizedStringTransformer constructor expects string\\|null, mixed given\\.$#" - count: 2 - path: src/Form/Type/DateRangeType.php - - - - message: "#^Parameter \\#1 \\$separator of function explode expects non\\-empty\\-string, mixed given\\.$#" - count: 1 - path: src/Form/Type/DateRangeType.php - - - - message: "#^Parameter \\#2 \\$outputTimezone of class Symfony\\\\Component\\\\Form\\\\Extension\\\\Core\\\\DataTransformer\\\\DateTimeToLocalizedStringTransformer constructor expects string\\|null, mixed given\\.$#" - count: 2 - path: src/Form/Type/DateRangeType.php - - - - message: "#^Parameter \\#4 \\$timezone of class IntlDateFormatter constructor expects DateTimeZone\\|IntlTimeZone\\|string\\|null, mixed given\\.$#" - count: 1 - path: src/Form/Type/DateRangeType.php - - - - message: "#^Parameter \\#6 \\$pattern of class IntlDateFormatter constructor expects string\\|null, mixed given\\.$#" - count: 1 - path: src/Form/Type/DateRangeType.php - - - - message: "#^Parameter \\#6 \\$pattern of class Symfony\\\\Component\\\\Form\\\\Extension\\\\Core\\\\DataTransformer\\\\DateTimeToLocalizedStringTransformer constructor expects string\\|null, mixed given\\.$#" - count: 1 - path: src/Form/Type/DateRangeType.php - - message: "#^Parameter \\#1 \\$inputTimezone of class Symfony\\\\Component\\\\Form\\\\Extension\\\\Core\\\\DataTransformer\\\\DateTimeToArrayTransformer constructor expects string\\|null, mixed given\\.$#" count: 1 diff --git a/src/Command/AbstractBundleInstallerCommand.php b/src/Command/AbstractBundleInstallerCommand.php index a3acf932..567e3ddf 100755 --- a/src/Command/AbstractBundleInstallerCommand.php +++ b/src/Command/AbstractBundleInstallerCommand.php @@ -72,7 +72,7 @@ abstract class AbstractBundleInstallerCommand extends Command */ protected function getInstallerCommandName(): string { - return sprintf('kimai:bundle:%s:install', $this->getBundleCommandNamePart()); + return \sprintf('kimai:bundle:%s:install', $this->getBundleCommandNamePart()); } /** @@ -87,7 +87,7 @@ abstract class AbstractBundleInstallerCommand extends Command if ($parts[0] !== 'KimaiPlugin') { throw new LogicException( - sprintf('Unsupported namespace given, expected "KimaiPlugin" but received "%s". Please overwrite getBundleName() and return the correct bundle name.', $parts[0]) + \sprintf('Unsupported namespace given, expected "KimaiPlugin" but received "%s". Please overwrite getBundleName() and return the correct bundle name.', $parts[0]) ); } @@ -114,14 +114,14 @@ abstract class AbstractBundleInstallerCommand extends Command $bundleName = $this->getBundleName(); $io->title( - sprintf('Starting installation of plugin: %s ...', $bundleName) + \sprintf('Starting installation of plugin: %s ...', $bundleName) ); try { $this->importMigrations($io, $output); } catch (\Exception $ex) { $io->error( - sprintf('Failed to install database for bundle %s. %s', $bundleName, $ex->getMessage()) + \sprintf('Failed to install database for bundle %s. %s', $bundleName, $ex->getMessage()) ); return Command::FAILURE; @@ -132,7 +132,7 @@ abstract class AbstractBundleInstallerCommand extends Command $this->installAssets($io, $output); } catch (\Exception $ex) { $io->error( - sprintf('Failed to install assets for bundle %s. %s', $bundleName, $ex->getMessage()) + \sprintf('Failed to install assets for bundle %s. %s', $bundleName, $ex->getMessage()) ); return Command::FAILURE; @@ -142,7 +142,7 @@ abstract class AbstractBundleInstallerCommand extends Command chdir($path); $io->success( - sprintf('Congratulations! Plugin was successful installed: %s', $bundleName) + \sprintf('Congratulations! Plugin was successful installed: %s', $bundleName) ); return Command::SUCCESS; diff --git a/src/Command/ActivateUserCommand.php b/src/Command/ActivateUserCommand.php index f391cfef..c82ff502 100644 --- a/src/Command/ActivateUserCommand.php +++ b/src/Command/ActivateUserCommand.php @@ -51,9 +51,9 @@ final class ActivateUserCommand extends Command if (!$user->isEnabled()) { $user->setEnabled(true); $this->userService->saveUser($user); - $io->success(sprintf('User "%s" has been activated.', $username)); + $io->success(\sprintf('User "%s" has been activated.', $username)); } else { - $io->warning(sprintf('User "%s" is already active.', $username)); + $io->warning(\sprintf('User "%s" is already active.', $username)); } return Command::SUCCESS; diff --git a/src/Command/ChangePasswordCommand.php b/src/Command/ChangePasswordCommand.php index 1fb3ccbc..9657667a 100644 --- a/src/Command/ChangePasswordCommand.php +++ b/src/Command/ChangePasswordCommand.php @@ -67,7 +67,7 @@ final class ChangePasswordCommand extends AbstractUserCommand try { $user->setPlainPassword($password); $this->userService->updateUser($user, ['PasswordUpdate']); - $io->success(sprintf('Changed password for user "%s".', $username)); + $io->success(\sprintf('Changed password for user "%s".', $username)); } catch (ValidationFailedException $ex) { $this->validationError($ex, $io); diff --git a/src/Command/CreateUserCommand.php b/src/Command/CreateUserCommand.php index e2078637..015c73bb 100644 --- a/src/Command/CreateUserCommand.php +++ b/src/Command/CreateUserCommand.php @@ -77,7 +77,7 @@ final class CreateUserCommand extends AbstractUserCommand try { $this->userService->saveUser($user); - $io->success(sprintf('Success! Created user: %s', $username)); + $io->success(\sprintf('Success! Created user: %s', $username)); } catch (ValidationFailedException $ex) { $this->validationError($ex, $io); diff --git a/src/Command/DeactivateUserCommand.php b/src/Command/DeactivateUserCommand.php index 0a0ef159..706b9219 100644 --- a/src/Command/DeactivateUserCommand.php +++ b/src/Command/DeactivateUserCommand.php @@ -51,9 +51,9 @@ final class DeactivateUserCommand extends Command if ($user->isEnabled()) { $user->setEnabled(false); $this->userService->saveUser($user); - $io->success(sprintf('User "%s" has been deactivated.', $username)); + $io->success(\sprintf('User "%s" has been deactivated.', $username)); } else { - $io->warning(sprintf('User "%s" is already deactivated.', $username)); + $io->warning(\sprintf('User "%s" is already deactivated.', $username)); } return Command::SUCCESS; diff --git a/src/Command/DemoteUserCommand.php b/src/Command/DemoteUserCommand.php index 60054833..8cf69f79 100644 --- a/src/Command/DemoteUserCommand.php +++ b/src/Command/DemoteUserCommand.php @@ -40,17 +40,17 @@ final class DemoteUserCommand extends AbstractRoleCommand if ($user->isSuperAdmin()) { $user->setSuperAdmin(false); $userService->saveUser($user); - $output->success(sprintf('Super administrator role has been removed from the user "%s".', $username)); + $output->success(\sprintf('Super administrator role has been removed from the user "%s".', $username)); } else { - $output->warning(sprintf('User "%s" doesn\'t have the super administrator role.', $username)); + $output->warning(\sprintf('User "%s" doesn\'t have the super administrator role.', $username)); } } else { if ($user->hasRole($role)) { $user->removeRole($role); $userService->saveUser($user); - $output->success(sprintf('Role "%s" has been removed from user "%s".', $role, $username)); + $output->success(\sprintf('Role "%s" has been removed from user "%s".', $role, $username)); } else { - $output->warning(sprintf('User "%s" didn\'t have "%s" role.', $username, $role)); + $output->warning(\sprintf('User "%s" didn\'t have "%s" role.', $username, $role)); } } } diff --git a/src/Command/ExportCreateCommand.php b/src/Command/ExportCreateCommand.php index 0970cb68..5c21ce40 100644 --- a/src/Command/ExportCreateCommand.php +++ b/src/Command/ExportCreateCommand.php @@ -35,13 +35,13 @@ use Symfony\Contracts\Translation\TranslatorInterface; final class ExportCreateCommand extends Command { public function __construct( - private ServiceExport $serviceExport, - private CustomerRepository $customerRepository, - private ProjectRepository $projectRepository, - private TeamRepository $teamRepository, - private UserRepository $userRepository, - private TranslatorInterface $translator, - private MailerInterface $mailer + private readonly ServiceExport $serviceExport, + private readonly CustomerRepository $customerRepository, + private readonly ProjectRepository $projectRepository, + private readonly TeamRepository $teamRepository, + private readonly UserRepository $userRepository, + private readonly TranslatorInterface $translator, + private readonly MailerInterface $mailer ) { parent::__construct(); } @@ -197,17 +197,19 @@ final class ExportCreateCommand extends Command $subject = 'Export data available'; $body = 'Your exported data is available, please find it attached to this email.'; + /** @var array $emails */ $emails = []; + /** @var array $tmp */ $tmp = $input->getOption('email'); if (\count($tmp) > 0) { foreach ($tmp as $email) { $result = filter_var($email, FILTER_VALIDATE_EMAIL); if ($result === false) { - $io->error('Invalid "email" given: ' . $email); + $io->error('Invalid "email" given'); return Command::FAILURE; } - $emails[] = $email; + $emails[] = (string) $email; } } @@ -227,7 +229,7 @@ final class ExportCreateCommand extends Command $user = $this->userRepository->loadUserByIdentifier($username); } catch(\Exception) { $io->error( - sprintf('The given username "%s" could not be resolved', $username) + \sprintf('The given username "%s" could not be resolved', $username) ); return Command::FAILURE; diff --git a/src/Command/InstallCommand.php b/src/Command/InstallCommand.php index 762e90ae..1983fe32 100644 --- a/src/Command/InstallCommand.php +++ b/src/Command/InstallCommand.php @@ -73,7 +73,7 @@ final class InstallCommand extends Command } $io->success( - sprintf('Congratulations! Successfully installed %s version %s', Constants::SOFTWARE, Constants::VERSION) + \sprintf('Congratulations! Successfully installed %s version %s', Constants::SOFTWARE, Constants::VERSION) ); return Command::SUCCESS; @@ -118,12 +118,12 @@ final class InstallCommand extends Command { try { if ($this->connection->isConnected()) { - $io->note(sprintf('Database is existing and connection could be established')); + $io->note(\sprintf('Database is existing and connection could be established')); return; } - if (!$this->askConfirmation($input, $output, sprintf('Create the database "%s" (yes) or skip (no)?', $this->connection->getDatabase()), true)) { + if (!$this->askConfirmation($input, $output, \sprintf('Create the database "%s" (yes) or skip (no)?', $this->connection->getDatabase()), true)) { throw new \Exception('Skipped database creation, aborting installation'); } } catch (\Exception $exception) { @@ -152,7 +152,7 @@ final class InstallCommand extends Command { /** @var QuestionHelper $questionHelper */ $questionHelper = $this->getHelperSet()->get('question'); - $text = sprintf('%s (yes/no) [%s]:', $question, $default ? 'yes' : 'no'); + $text = \sprintf('%s (yes/no) [%s]:', $question, $default ? 'yes' : 'no'); $question = new ConfirmationQuestion(' ' . $text . ' ', $default, '/^y|yes/i'); return $questionHelper->ask($input, $output, $question); diff --git a/src/Command/InvoiceCreateCommand.php b/src/Command/InvoiceCreateCommand.php index c14231a3..1cf73822 100644 --- a/src/Command/InvoiceCreateCommand.php +++ b/src/Command/InvoiceCreateCommand.php @@ -90,7 +90,7 @@ final class InvoiceCreateCommand extends Command $user = $this->userRepository->loadUserByIdentifier($username); } catch (\Exception $exception) { $io->error( - sprintf('The given username "%s" could not be resolved', $username) + \sprintf('The given username "%s" could not be resolved', $username) ); return Command::FAILURE; @@ -281,7 +281,7 @@ final class InvoiceCreateCommand extends Command $tpl = $this->getTemplateForCustomer($input, $customer); if (null === $tpl) { - $io->warning(sprintf('Could not find invoice template for project "%s", skipping!', $project->getName())); + $io->warning(\sprintf('Could not find invoice template for project "%s", skipping!', $project->getName())); continue; } $query->setTemplate($tpl); @@ -293,7 +293,7 @@ final class InvoiceCreateCommand extends Command $invoices[] = $this->serviceInvoice->createInvoice($this->serviceInvoice->createModel($query), $this->eventDispatcher); } } catch (\Exception $ex) { - $io->error(sprintf('Failed to create invoice for project "%s" with: %s', $project->getName(), $ex->getMessage())); + $io->error(\sprintf('Failed to create invoice for project "%s" with: %s', $project->getName(), $ex->getMessage())); } } @@ -352,7 +352,7 @@ final class InvoiceCreateCommand extends Command $tpl = $this->getTemplateForCustomer($input, $customer); if (null === $tpl) { - $io->warning(sprintf('Could not find invoice template for customer "%s", skipping!', $customer->getName())); + $io->warning(\sprintf('Could not find invoice template for customer "%s", skipping!', $customer->getName())); continue; } $query->setTemplate($tpl); @@ -364,7 +364,7 @@ final class InvoiceCreateCommand extends Command $invoices[] = $this->serviceInvoice->createInvoice($this->serviceInvoice->createModel($query), $this->eventDispatcher); } } catch (\Exception $ex) { - $io->error(sprintf('Failed to create invoice for customer "%s" with: %s', $customer->getName(), $ex->getMessage())); + $io->error(\sprintf('Failed to create invoice for customer "%s" with: %s', $customer->getName(), $ex->getMessage())); } } @@ -391,7 +391,7 @@ final class InvoiceCreateCommand extends Command $columns = ['Filename']; $table = new Table($output); - $table->setHeaderTitle(sprintf('Created %s invoice(s)', \count($invoices))); + $table->setHeaderTitle(\sprintf('Created %s invoice(s)', \count($invoices))); $table->setHeaders($columns); foreach ($invoices as $invoiceFile) { @@ -406,14 +406,14 @@ final class InvoiceCreateCommand extends Command $columns = ['ID', 'Customer', 'Total', 'Filename']; $table = new Table($output); - $table->setHeaderTitle(sprintf('Created %s invoice(s)', \count($invoices))); + $table->setHeaderTitle(\sprintf('Created %s invoice(s)', \count($invoices))); $table->setHeaders($columns); foreach ($invoices as $invoice) { $file = $this->serviceInvoice->getInvoiceFile($invoice); if (null === $file) { $io->warning( - sprintf('Created invoice with ID %s, but file was not found %s', $invoice->getId(), $invoice->getInvoiceFilename()) + \sprintf('Created invoice with ID %s, but file was not found %s', $invoice->getId(), $invoice->getInvoiceFilename()) ); continue; } diff --git a/src/Command/PromoteUserCommand.php b/src/Command/PromoteUserCommand.php index 8e162f0f..c003e446 100644 --- a/src/Command/PromoteUserCommand.php +++ b/src/Command/PromoteUserCommand.php @@ -40,17 +40,17 @@ final class PromoteUserCommand extends AbstractRoleCommand if (!$user->isSuperAdmin()) { $user->setSuperAdmin(true); $userService->saveUser($user); - $output->success(sprintf('User "%s" has been promoted as a super administrator.', $username)); + $output->success(\sprintf('User "%s" has been promoted as a super administrator.', $username)); } else { - $output->warning(sprintf('User "%s" does already have the super administrator role.', $username)); + $output->warning(\sprintf('User "%s" does already have the super administrator role.', $username)); } } else { if (!$user->hasRole($role)) { $user->addRole($role); $userService->saveUser($user); - $output->success(sprintf('Role "%s" has been added to user "%s".', $role, $username)); + $output->success(\sprintf('Role "%s" has been added to user "%s".', $role, $username)); } else { - $output->warning(sprintf('User "%s" did already have "%s" role.', $username, $role)); + $output->warning(\sprintf('User "%s" did already have "%s" role.', $username, $role)); } } } diff --git a/src/Command/RegenerateLocalesCommand.php b/src/Command/RegenerateLocalesCommand.php index 01cd9a2b..1d2a30cf 100644 --- a/src/Command/RegenerateLocalesCommand.php +++ b/src/Command/RegenerateLocalesCommand.php @@ -41,7 +41,7 @@ final class RegenerateLocalesCommand extends Command */ private array $noRegionCode = ['ar', 'id', 'pa', 'sl']; /** - * A list of locales that will be activated, not matter if translation files exist for them. + * A list of locales that will be activated, no matter if translation files exist for them. * * @var string[] */ diff --git a/src/Command/ReloadCommand.php b/src/Command/ReloadCommand.php index 2c2c87b0..e16a9d76 100644 --- a/src/Command/ReloadCommand.php +++ b/src/Command/ReloadCommand.php @@ -110,7 +110,7 @@ final class ReloadCommand extends Command } $io->success( - sprintf('Kimai config was reloaded') + \sprintf('Kimai config was reloaded') ); return Command::SUCCESS; diff --git a/src/Command/TimesheetStopAllCommand.php b/src/Command/TimesheetStopAllCommand.php index 5bff22e0..caa7fcca 100644 --- a/src/Command/TimesheetStopAllCommand.php +++ b/src/Command/TimesheetStopAllCommand.php @@ -38,7 +38,7 @@ final class TimesheetStopAllCommand extends Command if (!$output->isQuiet()) { $io = new SymfonyStyle($input, $output); - $io->success(sprintf('Stopped %s timesheet records.', $amount)); + $io->success(\sprintf('Stopped %s timesheet records.', $amount)); } return Command::SUCCESS; diff --git a/src/Command/TranslationCommand.php b/src/Command/TranslationCommand.php index 97faef2a..d1f22df1 100644 --- a/src/Command/TranslationCommand.php +++ b/src/Command/TranslationCommand.php @@ -28,7 +28,11 @@ use Symfony\Component\HttpClient\HttpClient; #[AsCommand(name: 'kimai:translations')] final class TranslationCommand extends Command { - public function __construct(private string $projectDirectory, private string $kernelEnvironment, private LocaleService $localeService) + public function __construct( + private readonly string $projectDirectory, + private readonly string $kernelEnvironment, + private readonly LocaleService $localeService + ) { parent::__construct(); } @@ -70,6 +74,7 @@ final class TranslationCommand extends Command $sources = []; if ($input->getOption('source') !== null) { + /** @var string $tmp */ $tmp = $input->getOption('source'); foreach ($bases as $directory) { $files = glob($directory); @@ -95,6 +100,7 @@ final class TranslationCommand extends Command $targets = []; if ($input->getOption('target') !== null) { + /** @var string $tmp */ $tmp = $input->getOption('target'); foreach ($bases as $directory) { $files = glob($directory); @@ -402,7 +408,7 @@ final class TranslationCommand extends Command $xmlContent = ''; foreach ($translations as $id => $values) { - $xmlContent .= sprintf( + $xmlContent .= \sprintf( '%s%s', $id, $values['resname'], @@ -463,7 +469,7 @@ final class TranslationCommand extends Command if (!\array_key_exists($key, $translations)) { throw new \Exception( - sprintf('Missing english translation for key: %s in file %s', $key, $file) + \sprintf('Missing english translation for key: %s in file %s', $key, $file) ); } $unit->target[0] = $translations[$key]; diff --git a/src/Command/UpdateCommand.php b/src/Command/UpdateCommand.php index 1bffe34a..a1451465 100644 --- a/src/Command/UpdateCommand.php +++ b/src/Command/UpdateCommand.php @@ -91,7 +91,7 @@ final class UpdateCommand extends Command if ($cacheResult !== Command::SUCCESS) { $io->warning( [ - sprintf('Updated %s to version %s but the cache could not be rebuilt.', Constants::SOFTWARE, Constants::VERSION), + \sprintf('Updated %s to version %s but the cache could not be rebuilt.', Constants::SOFTWARE, Constants::VERSION), 'Please run the cache commands manually:', 'bin/console cache:clear --env=' . $environment . PHP_EOL . 'bin/console cache:warmup --env=' . $environment @@ -99,7 +99,7 @@ final class UpdateCommand extends Command ); } else { $io->success( - sprintf('Congratulations! Successfully updated %s to version %s', Constants::SOFTWARE, Constants::VERSION) + \sprintf('Congratulations! Successfully updated %s to version %s', Constants::SOFTWARE, Constants::VERSION) ); } diff --git a/src/Command/VersionCommand.php b/src/Command/VersionCommand.php index 118b666f..5d7a4bd8 100644 --- a/src/Command/VersionCommand.php +++ b/src/Command/VersionCommand.php @@ -46,7 +46,7 @@ final class VersionCommand extends Command return Command::SUCCESS; } - $io->writeln(sprintf('%s %s by Kevin Papst.', Constants::SOFTWARE, Constants::VERSION)); + $io->writeln(\sprintf('%s %s by Kevin Papst.', Constants::SOFTWARE, Constants::VERSION)); return Command::SUCCESS; } diff --git a/src/Configuration/LocaleService.php b/src/Configuration/LocaleService.php index 1f67272c..58c09051 100644 --- a/src/Configuration/LocaleService.php +++ b/src/Configuration/LocaleService.php @@ -140,11 +140,11 @@ final class LocaleService private function getConfig(string $key, string $locale): string|bool { if (!isset($this->languageSettings[$locale])) { - throw new \InvalidArgumentException(sprintf('Unknown locale given: %s', $locale)); + throw new \InvalidArgumentException(\sprintf('Unknown locale given: %s', $locale)); } if (!isset($this->languageSettings[$locale][$key])) { - throw new \InvalidArgumentException(sprintf('Unknown setting for locale %s: %s', $locale, $key)); + throw new \InvalidArgumentException(\sprintf('Unknown setting for locale %s: %s', $locale, $key)); } return $this->languageSettings[$locale][$key]; diff --git a/src/ConsoleApplication.php b/src/ConsoleApplication.php index f7d9b693..b26b1264 100644 --- a/src/ConsoleApplication.php +++ b/src/ConsoleApplication.php @@ -33,6 +33,6 @@ final class ConsoleApplication extends Application */ public function getLongVersion(): string { - return sprintf('%s %s (env: %s, debug: %s)', $this->getName(), $this->getVersion(), $this->getKernel()->getEnvironment(), $this->getKernel()->isDebug() ? 'true' : 'false'); + return \sprintf('%s %s (env: %s, debug: %s)', $this->getName(), $this->getVersion(), $this->getKernel()->getEnvironment(), $this->getKernel()->isDebug() ? 'true' : 'false'); } } diff --git a/src/Constants.php b/src/Constants.php index 76d4c26d..5a40b51c 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -17,11 +17,11 @@ class Constants /** * The current release version */ - public const VERSION = '2.19.1'; + public const VERSION = '2.20.0'; /** * The current release: major * 10000 + minor * 100 + patch */ - public const VERSION_ID = 21901; + public const VERSION_ID = 22000; /** * The software name */ diff --git a/src/Controller/BookmarkController.php b/src/Controller/BookmarkController.php index bbd0c27c..53ca8c81 100644 --- a/src/Controller/BookmarkController.php +++ b/src/Controller/BookmarkController.php @@ -88,7 +88,7 @@ final class BookmarkController extends AbstractController } if (\count($enabled) > 50) { - throw new RuntimeException(sprintf('Too many columns provided, expected maximum 50, received %s.', \count($enabled))); + throw new RuntimeException(\sprintf('Too many columns provided, expected maximum 50, received %s.', \count($enabled))); } $user = $this->getUser(); diff --git a/src/Controller/DoctorController.php b/src/Controller/DoctorController.php index 1c616d84..94f900df 100644 --- a/src/Controller/DoctorController.php +++ b/src/Controller/DoctorController.php @@ -304,12 +304,12 @@ final class DoctorController extends AbstractController )) { foreach ($matches as $match) { $fn = $plainText; - if (isset($match[3])) { + if (isset($match[2]) && isset($match[3])) { $keys1 = array_keys($phpinfo); $phpinfo[end($keys1)][$fn($match[2])] = isset($match[4]) ? [$fn($match[3]), $fn($match[4])] : $fn($match[3]); } else { $keys1 = array_keys($phpinfo); - $phpinfo[end($keys1)][] = $fn($match[2]); + $phpinfo[end($keys1)][] = $fn($match[2]); // @phpstan-ignore-line } } } diff --git a/src/Controller/InvoiceController.php b/src/Controller/InvoiceController.php index 14734614..f9a2ff1b 100644 --- a/src/Controller/InvoiceController.php +++ b/src/Controller/InvoiceController.php @@ -319,7 +319,7 @@ final class InvoiceController extends AbstractController if (null === $file) { throw $this->createNotFoundException( - sprintf('Invoice file "%s" could not be found for invoice ID "%s"', $invoice->getInvoiceFilename(), $invoice->getId()) + \sprintf('Invoice file "%s" could not be found for invoice ID "%s"', $invoice->getInvoiceFilename(), $invoice->getId()) ); } diff --git a/src/Controller/PermissionController.php b/src/Controller/PermissionController.php index 5a1d7288..c010b75b 100644 --- a/src/Controller/PermissionController.php +++ b/src/Controller/PermissionController.php @@ -243,7 +243,7 @@ final class PermissionController extends AbstractController } if (false === $value && $role->getName() === User::ROLE_SUPER_ADMIN && \array_key_exists($name, RolePermissionManager::SUPER_ADMIN_PERMISSIONS)) { - throw new BadRequestHttpException(sprintf('Permission "%s" cannot be deactivated for role "%s"', $name, $role->getName())); + throw new BadRequestHttpException(\sprintf('Permission "%s" cannot be deactivated for role "%s"', $name, $role->getName())); } try { diff --git a/src/Controller/QuickEntryController.php b/src/Controller/QuickEntryController.php index f802fd96..0c510122 100644 --- a/src/Controller/QuickEntryController.php +++ b/src/Controller/QuickEntryController.php @@ -118,7 +118,7 @@ final class QuickEntryController extends AbstractController $startFrom = null; if ($takeOverWeeks !== null && \intval($takeOverWeeks) > 0) { $startFrom = clone $startWeek; - $startFrom->modify(sprintf('-%s weeks', $takeOverWeeks)); + $startFrom->modify(\sprintf('-%s weeks', $takeOverWeeks)); } $favorites = $this->favoriteRecordService->favoriteEntries($user, $amount); diff --git a/src/Controller/Security/PasswordResetController.php b/src/Controller/Security/PasswordResetController.php index 2e887611..bcf11ff7 100644 --- a/src/Controller/Security/PasswordResetController.php +++ b/src/Controller/Security/PasswordResetController.php @@ -71,7 +71,7 @@ final class PasswordResetController extends AbstractController if (!$user->isPasswordRequestNonExpired($this->configuration->getPasswordResetRetryLifetime())) { if (!$user->isInternalUser()) { throw $this->createAccessDeniedException( - sprintf('The user "%s" tried to reset the password, but it is registered as "%s" auth-type.', $user->getUserIdentifier(), $user->getAuth()) + \sprintf('The user "%s" tried to reset the password, but it is registered as "%s" auth-type.', $user->getUserIdentifier(), $user->getAuth()) ); } diff --git a/src/Controller/Security/SelfRegistrationController.php b/src/Controller/Security/SelfRegistrationController.php index fa1bd2ee..b5694b83 100644 --- a/src/Controller/Security/SelfRegistrationController.php +++ b/src/Controller/Security/SelfRegistrationController.php @@ -164,7 +164,7 @@ final class SelfRegistrationController extends AbstractController return null; } - $key = sprintf('_security.%s.target_path', $token->getProviderKey()); + $key = \sprintf('_security.%s.target_path', $token->getProviderKey()); if ($session->has($key)) { return $session->get($key); diff --git a/src/Controller/TeamController.php b/src/Controller/TeamController.php index 7825b8e9..c3bf5b3b 100644 --- a/src/Controller/TeamController.php +++ b/src/Controller/TeamController.php @@ -97,7 +97,7 @@ final class TeamController extends AbstractController $i = 1; do { - $newName = sprintf('%s (%s)', $team->getName(), $i++); + $newName = \sprintf('%s (%s)', $team->getName(), $i++); } while ($this->repository->count(['name' => $newName]) > 0 && $i < 10); $newTeam->setName($newName); diff --git a/src/Controller/TimesheetAbstractController.php b/src/Controller/TimesheetAbstractController.php index 02514f6b..4711c533 100644 --- a/src/Controller/TimesheetAbstractController.php +++ b/src/Controller/TimesheetAbstractController.php @@ -321,7 +321,7 @@ abstract class TimesheetAbstractController extends AbstractController } if ($disallowed > 0) { - $this->flashWarning(sprintf('You are missing the permission to edit %s timesheets', $disallowed)); + $this->flashWarning(\sprintf('You are missing the permission to edit %s timesheets', $disallowed)); } $dto->setEntities($timesheets); @@ -411,7 +411,7 @@ abstract class TimesheetAbstractController extends AbstractController $this->flashUpdateException($ex); } } else { - $this->flashSuccess(sprintf('No changes for %s entries detected.', \count($timesheets))); + $this->flashSuccess(\sprintf('No changes for %s entries detected.', \count($timesheets))); return $this->redirectToRoute($this->getTimesheetRoute()); } diff --git a/src/DependencyInjection/AppExtension.php b/src/DependencyInjection/AppExtension.php index ef6c617c..8dc8ba5b 100644 --- a/src/DependencyInjection/AppExtension.php +++ b/src/DependencyInjection/AppExtension.php @@ -77,7 +77,7 @@ final class AppExtension extends Extension } foreach ($bundleConfig as $key => $value) { if (\array_key_exists($key, $config)) { - throw new \Exception(sprintf('Invalid bundle configuration "%s" found, skipping', $key)); + throw new \Exception(\sprintf('Invalid bundle configuration "%s" found, skipping', $key)); } $config[$key] = $value; } diff --git a/src/Entity/ActivityMeta.php b/src/Entity/ActivityMeta.php index 93c12943..b3e4e754 100644 --- a/src/Entity/ActivityMeta.php +++ b/src/Entity/ActivityMeta.php @@ -31,7 +31,7 @@ class ActivityMeta implements MetaTableTypeInterface { if (!($entity instanceof Activity)) { throw new \InvalidArgumentException( - sprintf('Expected instanceof Activity, received "%s"', \get_class($entity)) + \sprintf('Expected instanceof Activity, received "%s"', \get_class($entity)) ); } $this->activity = $entity; diff --git a/src/Entity/CustomerMeta.php b/src/Entity/CustomerMeta.php index 828e1b97..f75d8974 100644 --- a/src/Entity/CustomerMeta.php +++ b/src/Entity/CustomerMeta.php @@ -31,7 +31,7 @@ class CustomerMeta implements MetaTableTypeInterface { if (!($entity instanceof Customer)) { throw new \InvalidArgumentException( - sprintf('Expected instanceof Customer, received "%s"', \get_class($entity)) + \sprintf('Expected instanceof Customer, received "%s"', \get_class($entity)) ); } $this->customer = $entity; diff --git a/src/Entity/InvoiceMeta.php b/src/Entity/InvoiceMeta.php index 01a837d9..428b98bc 100644 --- a/src/Entity/InvoiceMeta.php +++ b/src/Entity/InvoiceMeta.php @@ -31,7 +31,7 @@ class InvoiceMeta implements MetaTableTypeInterface { if (!($entity instanceof Invoice)) { throw new \InvalidArgumentException( - sprintf('Expected instanceof Invoice, received "%s"', \get_class($entity)) + \sprintf('Expected instanceof Invoice, received "%s"', \get_class($entity)) ); } $this->invoice = $entity; diff --git a/src/Entity/ProjectMeta.php b/src/Entity/ProjectMeta.php index 5c5dcd19..c3199bf4 100644 --- a/src/Entity/ProjectMeta.php +++ b/src/Entity/ProjectMeta.php @@ -31,7 +31,7 @@ class ProjectMeta implements MetaTableTypeInterface { if (!($entity instanceof Project)) { throw new \InvalidArgumentException( - sprintf('Expected instanceof Project, received "%s"', \get_class($entity)) + \sprintf('Expected instanceof Project, received "%s"', \get_class($entity)) ); } $this->project = $entity; diff --git a/src/Entity/Timesheet.php b/src/Entity/Timesheet.php index d3a0f213..b6e364e3 100644 --- a/src/Entity/Timesheet.php +++ b/src/Entity/Timesheet.php @@ -491,7 +491,7 @@ class Timesheet implements EntityWithMetaFields, ExportableItem, ModifiedAt $allowed = [self::WORK, self::HOLIDAY, self::SICKNESS, self::PARENTAL, self::OVERTIME]; if (!\in_array($category, $allowed)) { - throw new \InvalidArgumentException(sprintf('Invalid timesheet category "%s" given, expected one of: %s', $category, implode(', ', $allowed))); + throw new \InvalidArgumentException(\sprintf('Invalid timesheet category "%s" given, expected one of: %s', $category, implode(', ', $allowed))); } $this->category = $category; diff --git a/src/Entity/TimesheetMeta.php b/src/Entity/TimesheetMeta.php index 380bb9a9..130b79e5 100644 --- a/src/Entity/TimesheetMeta.php +++ b/src/Entity/TimesheetMeta.php @@ -31,7 +31,7 @@ class TimesheetMeta implements MetaTableTypeInterface { if (!($entity instanceof Timesheet)) { throw new \InvalidArgumentException( - sprintf('Expected instanceof Timesheet, received "%s"', \get_class($entity)) + \sprintf('Expected instanceof Timesheet, received "%s"', \get_class($entity)) ); } $this->timesheet = $entity; diff --git a/src/Export/Annotation/Expose.php b/src/Export/Annotation/Expose.php index ce08a2b1..a7961f2c 100644 --- a/src/Export/Annotation/Expose.php +++ b/src/Export/Annotation/Expose.php @@ -17,7 +17,7 @@ final class Expose public function __construct(public ?string $name = null, public ?string $label = null, string $type = 'string', public ?string $exp = null, public ?string $translationDomain = null) { if (!\in_array($type, ['string', 'datetime', 'date', 'time', 'integer', 'float', 'duration', 'boolean', 'array'])) { - throw new \InvalidArgumentException(sprintf('Unknown type "%s" on annotation "%s".', $type, self::class)); + throw new \InvalidArgumentException(\sprintf('Unknown type "%s" on annotation "%s".', $type, self::class)); } $this->type = $type; } diff --git a/src/Export/Base/AbstractSpreadsheetRenderer.php b/src/Export/Base/AbstractSpreadsheetRenderer.php index cacb4290..0b1d1797 100644 --- a/src/Export/Base/AbstractSpreadsheetRenderer.php +++ b/src/Export/Base/AbstractSpreadsheetRenderer.php @@ -194,7 +194,7 @@ abstract class AbstractSpreadsheetRenderer protected function setDurationTotal(Worksheet $sheet, int $column, int $row, string $startCoordinate, string $endCoordinate): void { - $sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), sprintf('=SUBTOTAL(9,%s:%s)', $startCoordinate, $endCoordinate)); + $sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), \sprintf('=SUBTOTAL(9,%s:%s)', $startCoordinate, $endCoordinate)); $style = $sheet->getStyle(CellAddress::fromColumnAndRow($column, $row)); $style->getNumberFormat()->setFormatCode($this->durationFormat); } @@ -204,19 +204,19 @@ abstract class AbstractSpreadsheetRenderer if (null === $duration) { $duration = 0; } - $sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), sprintf('=%s/%s', $duration, $this->durationBase)); + $sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), \sprintf('=%s/%s', $duration, $this->durationBase)); $sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode($this->durationFormat); } protected function setRateTotal(Worksheet $sheet, int $column, int $row, string $startCoordinate, string $endCoordinate): void { - $sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), sprintf('=SUBTOTAL(9,%s:%s)', $startCoordinate, $endCoordinate)); + $sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), \sprintf('=SUBTOTAL(9,%s:%s)', $startCoordinate, $endCoordinate)); } protected function setRateStyle(Worksheet $sheet, int $column, int $row, ?string $currency): void { $sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode( - sprintf($this->rateFormat, $currency ?? '') + \sprintf($this->rateFormat, $currency ?? '') ); } @@ -710,7 +710,7 @@ abstract class AbstractSpreadsheetRenderer } if (!\array_key_exists('render', $settings) || !\is_callable($settings['render'])) { - throw new \RuntimeException(sprintf('Missing or invalid renderer for export column %s', $label)); + throw new \RuntimeException(\sprintf('Missing or invalid renderer for export column %s', $label)); } $amount = $settings['render']($sheet, $entryHeaderRow, $entryHeaderColumn, $exportItem); diff --git a/src/Export/Base/CsvRenderer.php b/src/Export/Base/CsvRenderer.php index 5ca9405f..ec5a3828 100644 --- a/src/Export/Base/CsvRenderer.php +++ b/src/Export/Base/CsvRenderer.php @@ -57,7 +57,7 @@ class CsvRenderer extends AbstractSpreadsheetRenderer protected function setDuration(Worksheet $sheet, int $column, int $row, ?int $duration): void { - $sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), sprintf('=%s', $duration ?? 0)); + $sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), \sprintf('=%s', $duration ?? 0)); } protected function setRate(Worksheet $sheet, int $column, int $row, ?float $rate, ?string $currency): void diff --git a/src/Export/ServiceExport.php b/src/Export/ServiceExport.php index 1cb640a8..9bdb9b6e 100644 --- a/src/Export/ServiceExport.php +++ b/src/Export/ServiceExport.php @@ -161,7 +161,7 @@ final class ServiceExport $items = array_merge($items, $repository->getExportItemsForQuery($query)); if ($max !== null && \count($items) > $max) { throw new TooManyItemsExportException( - sprintf('Limit reached! Expected max. %s items but got %s', $max, \count($items)) + \sprintf('Limit reached! Expected max. %s items but got %s', $max, \count($items)) ); } } diff --git a/src/Export/Spreadsheet/CellFormatter/DurationFormatter.php b/src/Export/Spreadsheet/CellFormatter/DurationFormatter.php index f3696638..eeb5ad09 100644 --- a/src/Export/Spreadsheet/CellFormatter/DurationFormatter.php +++ b/src/Export/Spreadsheet/CellFormatter/DurationFormatter.php @@ -26,7 +26,7 @@ final class DurationFormatter implements CellFormatterInterface throw new \InvalidArgumentException('Unsupported value given, only int is supported'); } - $sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), sprintf('=%s/86400', $value)); + $sheet->setCellValue(CellAddress::fromColumnAndRow($column, $row), \sprintf('=%s/86400', $value)); $sheet->getStyle(CellAddress::fromColumnAndRow($column, $row))->getNumberFormat()->setFormatCode(self::DURATION_FORMAT); } } diff --git a/src/Export/Spreadsheet/Extractor/AnnotationExtractor.php b/src/Export/Spreadsheet/Extractor/AnnotationExtractor.php index 1b9b565f..1e2d34a1 100644 --- a/src/Export/Spreadsheet/Extractor/AnnotationExtractor.php +++ b/src/Export/Spreadsheet/Extractor/AnnotationExtractor.php @@ -56,13 +56,13 @@ final class AnnotationExtractor implements ExtractorInterface foreach ($definitions as $definition) { $arguments = $definition->getArguments(); if (!\array_key_exists('name', $arguments) || $arguments['name'] === null) { - throw new ExtractorException(sprintf('@Expose needs the "name" attribute on class level hierarchy, check %s::class', $value)); + throw new ExtractorException(\sprintf('@Expose needs the "name" attribute on class level hierarchy, check %s::class', $value)); } if (!\array_key_exists('exp', $arguments) || $arguments['exp'] === null) { - throw new ExtractorException(sprintf('@Expose needs the "exp" attribute on class level hierarchy, check %s::class', $value)); + throw new ExtractorException(\sprintf('@Expose needs the "exp" attribute on class level hierarchy, check %s::class', $value)); } if (!\array_key_exists('label', $arguments) || $arguments['label'] === null) { - throw new ExtractorException(sprintf('@Expose needs the "label" attribute on class level hierarchy, check %s::class', $value)); + throw new ExtractorException(\sprintf('@Expose needs the "label" attribute on class level hierarchy, check %s::class', $value)); } $parsed = $this->expressionLanguage->parse($arguments['exp'], ['object']); @@ -87,10 +87,10 @@ final class AnnotationExtractor implements ExtractorInterface foreach ($definitions as $definition) { $arguments = $definition->getArguments(); if (\array_key_exists('exp', $arguments) && $arguments['exp'] !== null) { - throw new ExtractorException(sprintf('@Expose only supports the "exp" attribute on class level hierarchy, check %s::$%s', $value, $property->getName())); + throw new ExtractorException(\sprintf('@Expose only supports the "exp" attribute on class level hierarchy, check %s::$%s', $value, $property->getName())); } if (!\array_key_exists('label', $arguments) || $arguments['label'] === null) { - throw new ExtractorException(sprintf('@Expose needs the "label" attribute on property level hierarchy, check %s::$%s', $value, $property->getName())); + throw new ExtractorException(\sprintf('@Expose needs the "label" attribute on property level hierarchy, check %s::$%s', $value, $property->getName())); } $name = $property->getName(); @@ -120,15 +120,15 @@ final class AnnotationExtractor implements ExtractorInterface $definitions = $method->getAttributes(Expose::class); foreach ($definitions as $definition) { if (\count($method->getParameters()) > 0) { - throw new ExtractorException(sprintf('@Expose does not support method %s::%s(...) as it has required parameters.', $value, $method->getName())); + throw new ExtractorException(\sprintf('@Expose does not support method %s::%s(...) as it has required parameters.', $value, $method->getName())); } $arguments = $definition->getArguments(); if (\array_key_exists('exp', $arguments) && $arguments['exp'] !== null) { - throw new ExtractorException(sprintf('@Expose only supports the "exp" attribute on method level hierarchy, check %s::%s()', $value, $method->getName())); + throw new ExtractorException(\sprintf('@Expose only supports the "exp" attribute on method level hierarchy, check %s::%s()', $value, $method->getName())); } if (!\array_key_exists('label', $arguments) || $arguments['label'] === null) { - throw new ExtractorException(sprintf('@Expose needs the "label" attribute on method level hierarchy, check %s::%s()', $value, $method->getName())); + throw new ExtractorException(\sprintf('@Expose needs the "label" attribute on method level hierarchy, check %s::%s()', $value, $method->getName())); } $name = $method->getName(); diff --git a/src/Form/Type/ColorPickerType.php b/src/Form/Type/ColorPickerType.php index fcc90f61..c8f18fe9 100644 --- a/src/Form/Type/ColorPickerType.php +++ b/src/Form/Type/ColorPickerType.php @@ -30,7 +30,7 @@ final class ColorPickerType extends AbstractType implements DataTransformerInter $resolver->setDefaults([ 'documentation' => [ 'type' => 'string', - 'description' => sprintf('The hexadecimal color code (default: %s)', self::DEFAULT_COLOR), + 'description' => \sprintf('The hexadecimal color code (default: %s)', self::DEFAULT_COLOR), ], 'label' => 'color', 'empty_data' => null, diff --git a/src/Form/Type/DateRangeType.php b/src/Form/Type/DateRangeType.php index d0fd976b..a8c934a6 100644 --- a/src/Form/Type/DateRangeType.php +++ b/src/Form/Type/DateRangeType.php @@ -49,7 +49,8 @@ final class DateRangeType extends AbstractType 'max_day' => null, 'locale' => \Locale::getDefault(), ]); - $resolver->addAllowedTypes('timezone', ['string']); + $resolver->setAllowedTypes('separator', 'string'); + $resolver->addAllowedTypes('timezone', 'string'); $resolver->addAllowedTypes('min_day', ['null', 'string', \DateTimeInterface::class]); $resolver->addAllowedTypes('max_day', ['null', 'string', \DateTimeInterface::class]); @@ -59,6 +60,7 @@ final class DateRangeType extends AbstractType return $converter->convert($format); }); + $resolver->setAllowedTypes('format', ['string']); $resolver->setDefault('attr', function (Options $options): array { $format = $this->localeService->getDateFormat($options['locale']); @@ -115,7 +117,10 @@ final class DateRangeType extends AbstractType } } - public function buildForm(FormBuilderInterface $builder, array $options): void + /** + * @param array{'format': non-empty-string, 'separator': non-empty-string, 'allow_empty': true, 'timezone': non-empty-string} $options + */ + public function buildForm(FormBuilderInterface $builder, array $options): void // @phpstan-ignore-line { $formatDate = $options['format']; $separator = $options['separator']; diff --git a/src/Form/Type/DurationType.php b/src/Form/Type/DurationType.php index 0d3b2b34..41789c75 100644 --- a/src/Form/Type/DurationType.php +++ b/src/Form/Type/DurationType.php @@ -34,6 +34,7 @@ final class DurationType extends AbstractType 'max_hours' => 24, 'icon' => 'clock', ]); + $resolver->setAllowedTypes('max_hours', 'int'); } public function buildView(FormView $view, FormInterface $form, array $options): void @@ -54,7 +55,7 @@ final class DurationType extends AbstractType } // we track times for humans and no entry should ever be that long - if ($maxHours > $options['max_hours']) { + if (\is_int($options['max_hours']) && $maxHours > $options['max_hours']) { $maxHours = $options['max_hours']; } diff --git a/src/Form/Type/UserLocaleType.php b/src/Form/Type/UserLocaleType.php index 9d484ddc..fb9c0205 100644 --- a/src/Form/Type/UserLocaleType.php +++ b/src/Form/Type/UserLocaleType.php @@ -36,7 +36,7 @@ final class UserLocaleType extends AbstractType $resolver->setDefaults([ 'label' => 'locale', 'help_html' => true, - 'help' => sprintf('%2$s', $route, $moreLink) + 'help' => \sprintf('%2$s', $route, $moreLink) ]); } diff --git a/src/Invoice/ServiceInvoice.php b/src/Invoice/ServiceInvoice.php index 6cbe9d07..0e4d90d3 100644 --- a/src/Invoice/ServiceInvoice.php +++ b/src/Invoice/ServiceInvoice.php @@ -212,11 +212,11 @@ final class ServiceInvoice } if (mb_strlen($filename) >= 150) { - throw new \Exception(sprintf('Invoice filename "%s" is too long, max. 150 characters allowed', $filename)); + throw new \Exception(\sprintf('Invoice filename "%s" is too long, max. 150 characters allowed', $filename)); } if (is_file($invoiceDirectory . $filename)) { - throw new \Exception(sprintf('Invoice "%s" already exists', $filename)); + throw new \Exception(\sprintf('Invoice "%s" already exists', $filename)); } if ($response instanceof BinaryFileResponse) { @@ -303,7 +303,7 @@ final class ServiceInvoice } throw new \Exception( - sprintf('Cannot render invoice: %s (%s)', $model->getTemplate()->getRenderer(), $document->getName()) + \sprintf('Cannot render invoice: %s (%s)', $model->getTemplate()->getRenderer(), $document->getName()) ); } @@ -354,7 +354,7 @@ final class ServiceInvoice } throw new \Exception( - sprintf('Cannot render invoice: %s (%s)', $model->getTemplate()->getRenderer(), $document->getName()) + \sprintf('Cannot render invoice: %s (%s)', $model->getTemplate()->getRenderer(), $document->getName()) ); } diff --git a/src/Kernel.php b/src/Kernel.php index 6e2b5d2e..4c36e9d0 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -106,13 +106,13 @@ class Kernel extends BaseKernel $plugin = new $pluginClass(); if (!$plugin instanceof PluginInterface) { - throw new \Exception(sprintf('Bundle "%s" does not implement %s, which is not supported since 2.0.', $bundleName, PluginInterface::class)); + throw new \Exception(\sprintf('Bundle "%s" does not implement %s, which is not supported since 2.0.', $bundleName, PluginInterface::class)); } $meta = new PluginMetadata($fullPath); if ($meta->getKimaiVersion() > Constants::VERSION_ID) { - throw new \Exception(sprintf('Bundle "%s" requires minimum Kimai version %s, but yours is lower: %s (%s). Please update Kimai or use a lower Plugin version.', $bundleName, $meta->getKimaiVersion(), Constants::VERSION, Constants::VERSION_ID)); + throw new \Exception(\sprintf('Bundle "%s" requires minimum Kimai version %s, but yours is lower: %s (%s). Please update Kimai or use a lower Plugin version.', $bundleName, $meta->getKimaiVersion(), Constants::VERSION, Constants::VERSION_ID)); } $plugins[] = $plugin; diff --git a/src/Ldap/LdapAuthenticator.php b/src/Ldap/LdapAuthenticator.php index 6096cae7..1dce3611 100644 --- a/src/Ldap/LdapAuthenticator.php +++ b/src/Ldap/LdapAuthenticator.php @@ -77,7 +77,7 @@ final class LdapAuthenticator implements AuthenticationEntryPointInterface, Inte public function start(Request $request, AuthenticationException $authException = null): Response { if (!$this->authenticator instanceof AuthenticationEntryPointInterface) { - throw new NotAnEntryPointException(sprintf('Decorated authenticator "%s" does not implement interface "%s".', get_debug_type($this->authenticator), AuthenticationEntryPointInterface::class)); + throw new NotAnEntryPointException(\sprintf('Decorated authenticator "%s" does not implement interface "%s".', get_debug_type($this->authenticator), AuthenticationEntryPointInterface::class)); } return $this->authenticator->start($request, $authException); diff --git a/src/Ldap/LdapCredentialsSubscriber.php b/src/Ldap/LdapCredentialsSubscriber.php index 8fdfb7ce..c3d8576d 100644 --- a/src/Ldap/LdapCredentialsSubscriber.php +++ b/src/Ldap/LdapCredentialsSubscriber.php @@ -41,7 +41,7 @@ final class LdapCredentialsSubscriber implements EventSubscriberInterface } if (!$passport instanceof Passport || !$passport->hasBadge(PasswordCredentials::class)) { - throw new \LogicException(sprintf('LDAP authentication requires a passport containing a user and password credentials, authenticator "%s" does not fulfill these requirements.', \get_class($event->getAuthenticator()))); + throw new \LogicException(\sprintf('LDAP authentication requires a passport containing a user and password credentials, authenticator "%s" does not fulfill these requirements.', \get_class($event->getAuthenticator()))); } /** @var PasswordCredentials $passwordCredentials */ diff --git a/src/Ldap/LdapManager.php b/src/Ldap/LdapManager.php index b9419108..42f691e0 100644 --- a/src/Ldap/LdapManager.php +++ b/src/Ldap/LdapManager.php @@ -60,10 +60,10 @@ class LdapManager $filters[] = $params['filter']; foreach ($criteria as $key => $value) { $value = ldap_escape($value, '', LDAP_ESCAPE_FILTER); - $filters[] = sprintf('(%s=%s)', $key, $value); + $filters[] = \sprintf('(%s=%s)', $key, $value); } - return sprintf('(%s%s)', $condition, implode($filters)); + return \sprintf('(%s%s)', $condition, implode($filters)); } public function bind(string $dn, string $password): bool @@ -84,7 +84,7 @@ class LdapManager // always look up the users current DN first, as the current user might be upgraded from local to LDAP $userFresh = $this->findUserByUsername($user->getUserIdentifier()); if (null === $userFresh || null === ($baseDn = $userFresh->getPreferenceValue('ldap_dn'))) { - throw new LdapDriverException(sprintf('Failed fetching user DN for %s', $user->getUserIdentifier())); + throw new LdapDriverException(\sprintf('Failed fetching user DN for %s', $user->getUserIdentifier())); } $user->setPreferenceValue('ldap_dn', $baseDn); @@ -128,7 +128,7 @@ class LdapManager return $this->driver->search( $roleParameter['baseDn'], - sprintf('(&%s(%s=%s))', $filter, $roleParameter['userDnAttribute'], ldap_escape($dn, '', LDAP_ESCAPE_FILTER)), + \sprintf('(&%s(%s=%s))', $filter, $roleParameter['userDnAttribute'], ldap_escape($dn, '', LDAP_ESCAPE_FILTER)), [$roleParameter['nameAttribute']] ); } @@ -200,7 +200,7 @@ class LdapManager } if (!$mapped) { - $roleName = sprintf('ROLE_%s', self::slugify($roleName)); + $roleName = \sprintf('ROLE_%s', self::slugify($roleName)); } if (!\in_array($roleName, $allowedRoles, true)) { diff --git a/src/Ldap/LdapUserProvider.php b/src/Ldap/LdapUserProvider.php index d6e7f099..7c3668bb 100644 --- a/src/Ldap/LdapUserProvider.php +++ b/src/Ldap/LdapUserProvider.php @@ -35,7 +35,7 @@ final class LdapUserProvider implements UserProviderInterface 'username' => $identifier, 'result' => 'not found', ]); - $ex = new UserNotFoundException(sprintf('User "%s" not found', $identifier)); + $ex = new UserNotFoundException(\sprintf('User "%s" not found', $identifier)); $ex->setUserIdentifier($identifier); throw $ex; @@ -53,17 +53,17 @@ final class LdapUserProvider implements UserProviderInterface public function refreshUser(UserInterface $user): UserInterface { if (!($user instanceof User)) { - throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', \get_class($user))); + throw new UnsupportedUserException(\sprintf('Instances of "%s" are not supported.', \get_class($user))); } if (!$user->isLdapUser()) { - throw new UnsupportedUserException(sprintf('Account "%s" is not a registered LDAP user.', $user->getUserIdentifier())); + throw new UnsupportedUserException(\sprintf('Account "%s" is not a registered LDAP user.', $user->getUserIdentifier())); } try { $this->ldapManager->updateUser($user); } catch (LdapDriverException $ex) { - throw new UnsupportedUserException(sprintf('Failed to refresh user "%s", probably DN is expired.', $user->getUserIdentifier())); + throw new UnsupportedUserException(\sprintf('Failed to refresh user "%s", probably DN is expired.', $user->getUserIdentifier())); } return $user; diff --git a/src/Model/Statistic/Month.php b/src/Model/Statistic/Month.php index 0cfcbf26..c222f21a 100644 --- a/src/Model/Statistic/Month.php +++ b/src/Model/Statistic/Month.php @@ -25,7 +25,7 @@ final class Month extends Timesheet $monthNumber = (int) $month; if ($monthNumber < 1 || $monthNumber > 12) { throw new InvalidArgumentException( - sprintf('Invalid month given. Expected 1-12, received "%s".', $monthNumber) + \sprintf('Invalid month given. Expected 1-12, received "%s".', $monthNumber) ); } $this->month = str_pad($month, 2, '0', STR_PAD_LEFT); diff --git a/src/Plugin/PluginMetadata.php b/src/Plugin/PluginMetadata.php index 2c955484..3d15e161 100644 --- a/src/Plugin/PluginMetadata.php +++ b/src/Plugin/PluginMetadata.php @@ -25,36 +25,36 @@ class PluginMetadata public function __construct(string $path) { if (!is_dir($path) || !is_readable($path)) { - throw new \Exception(sprintf('Bundle directory "%s" cannot be accessed.', $path)); + throw new \Exception(\sprintf('Bundle directory "%s" cannot be accessed.', $path)); } $pluginName = basename($path); $composer = $path . '/composer.json'; if (!file_exists($composer) || !is_readable($composer)) { - throw new \Exception(sprintf('Bundle "%s" does not ship composer.json, which is required since 2.0.', $pluginName)); + throw new \Exception(\sprintf('Bundle "%s" does not ship composer.json, which is required since 2.0.', $pluginName)); } $json = json_decode(file_get_contents($composer), true); if (!\array_key_exists('extra', $json)) { - throw new \Exception(sprintf('Bundle "%s" does not define an "extra" node in composer.json, which is required since 2.0.', $pluginName)); + throw new \Exception(\sprintf('Bundle "%s" does not define an "extra" node in composer.json, which is required since 2.0.', $pluginName)); } if (!\array_key_exists('kimai', $json['extra'])) { - throw new \Exception(sprintf('Bundle "%s" does not define the "extra.kimai" node in composer.json, which is required since 2.0.', $pluginName)); + throw new \Exception(\sprintf('Bundle "%s" does not define the "extra.kimai" node in composer.json, which is required since 2.0.', $pluginName)); } if (!\array_key_exists('require', $json['extra']['kimai'])) { - throw new \Exception(sprintf('Bundle "%s" does not define the minimum Kimai version in "extra.kimai.required" in composer.json, which is required since 2.0.', $pluginName)); + throw new \Exception(\sprintf('Bundle "%s" does not define the minimum Kimai version in "extra.kimai.required" in composer.json, which is required since 2.0.', $pluginName)); } if (!\array_key_exists('name', $json['extra']['kimai'])) { - throw new \Exception(sprintf('Bundle "%s" does not define its name in "extra.kimai.name" in composer.json, which is required since 2.0.', $pluginName)); + throw new \Exception(\sprintf('Bundle "%s" does not define its name in "extra.kimai.name" in composer.json, which is required since 2.0.', $pluginName)); } if (!\is_int($json['extra']['kimai']['require'])) { - throw new \Exception(sprintf('Bundle "%s" defines an invalid Kimai minimum version in extra.kimai.require. Please provide an integer as in Constants::VERSION_ID.', $pluginName)); + throw new \Exception(\sprintf('Bundle "%s" defines an invalid Kimai minimum version in extra.kimai.require. Please provide an integer as in Constants::VERSION_ID.', $pluginName)); } $this->description = $json['description'] ?? ''; diff --git a/src/Repository/RepositorySearchTrait.php b/src/Repository/RepositorySearchTrait.php index bb01bdda..33fc8987 100644 --- a/src/Repository/RepositorySearchTrait.php +++ b/src/Repository/RepositorySearchTrait.php @@ -76,7 +76,7 @@ trait RepositorySearchTrait $and->add($qb->expr()->isNotNull($alias . '.value')); } elseif ($metaValue === '~') { $and->add( - sprintf('NOT EXISTS(SELECT metaNotExists FROM %s metaNotExists WHERE metaNotExists.%s = %s.id)', $this->getMetaFieldClass(), $this->getMetaFieldName(), $rootAlias) + \sprintf('NOT EXISTS(SELECT metaNotExists FROM %s metaNotExists WHERE metaNotExists.%s = %s.id)', $this->getMetaFieldClass(), $this->getMetaFieldName(), $rootAlias) ); } elseif ($metaValue === '' || $metaValue === null) { $qb->leftJoin($rootAlias . '.meta', $alias); @@ -86,7 +86,7 @@ trait RepositorySearchTrait $qb->expr()->eq($alias . '.name', ':' . $paramName), $qb->expr()->isNull($alias . '.value') ), - sprintf('NOT EXISTS(SELECT metaNotExists FROM %s metaNotExists WHERE metaNotExists.%s = %s.id)', $this->getMetaFieldClass(), $this->getMetaFieldName(), $rootAlias) + \sprintf('NOT EXISTS(SELECT metaNotExists FROM %s metaNotExists WHERE metaNotExists.%s = %s.id)', $this->getMetaFieldClass(), $this->getMetaFieldName(), $rootAlias) ) ); $qb->setParameter($paramName, $metaName); diff --git a/src/Saml/SamlAuthenticator.php b/src/Saml/SamlAuthenticator.php index f6e8329c..80d3e9cb 100644 --- a/src/Saml/SamlAuthenticator.php +++ b/src/Saml/SamlAuthenticator.php @@ -98,7 +98,7 @@ class SamlAuthenticator extends AbstractAuthenticator if (isset($this->options['username_attribute'])) { if (!\array_key_exists($this->options['username_attribute'], $attributes)) { - throw new \Exception(sprintf("Attribute '%s' not found in SAML data", $this->options['username_attribute'])); + throw new \Exception(\sprintf("Attribute '%s' not found in SAML data", $this->options['username_attribute'])); } $username = $attributes[$this->options['username_attribute']][0]; diff --git a/src/Saml/SamlLoginAttributes.php b/src/Saml/SamlLoginAttributes.php index 0b786678..981af117 100644 --- a/src/Saml/SamlLoginAttributes.php +++ b/src/Saml/SamlLoginAttributes.php @@ -32,7 +32,7 @@ final class SamlLoginAttributes public function getAttribute(string $name): mixed { if (!\array_key_exists($name, $this->attributes)) { - throw new \InvalidArgumentException(sprintf('This SAML login has no "%s" attribute.', $name)); + throw new \InvalidArgumentException(\sprintf('This SAML login has no "%s" attribute.', $name)); } return $this->attributes[$name]; diff --git a/src/Saml/SamlProvider.php b/src/Saml/SamlProvider.php index 02a16997..54597889 100644 --- a/src/Saml/SamlProvider.php +++ b/src/Saml/SamlProvider.php @@ -54,7 +54,7 @@ final class SamlProvider } catch (\Exception $ex) { $this->logger->error($ex->getMessage()); throw new AuthenticationException( - sprintf('Failed creating or hydrating user "%s": %s', $token->getUserIdentifier(), $ex->getMessage()) + \sprintf('Failed creating or hydrating user "%s": %s', $token->getUserIdentifier(), $ex->getMessage()) ); } diff --git a/src/Twig/LocaleFormatExtensions.php b/src/Twig/LocaleFormatExtensions.php index e3f807bf..51de56a4 100644 --- a/src/Twig/LocaleFormatExtensions.php +++ b/src/Twig/LocaleFormatExtensions.php @@ -173,7 +173,7 @@ final class LocaleFormatExtensions extends AbstractExtension implements LocaleAw } $months = []; for ($i = 1; $i < 13; $i++) { - $months[] = $this->getFormatter()->monthName(new DateTime(sprintf('%s-%s-10', $year, ($i < 10 ? '0' . $i : (string) $i))), $withYear); + $months[] = $this->getFormatter()->monthName(new DateTime(\sprintf('%s-%s-10', $year, ($i < 10 ? '0' . $i : (string) $i))), $withYear); } return $months; diff --git a/src/Twig/Runtime/WidgetExtension.php b/src/Twig/Runtime/WidgetExtension.php index 524e3549..0cb0ff11 100644 --- a/src/Twig/Runtime/WidgetExtension.php +++ b/src/Twig/Runtime/WidgetExtension.php @@ -37,7 +37,7 @@ final class WidgetExtension implements RuntimeExtensionInterface if (\is_string($widget)) { if (!$this->service->hasWidget($widget)) { - throw new \InvalidArgumentException(sprintf('Unknown widget "%s" requested', $widget)); + throw new \InvalidArgumentException(\sprintf('Unknown widget "%s" requested', $widget)); } $widget = $this->service->getWidget($widget); diff --git a/src/Twig/SecurityPolicy/ForbiddenPolicy.php b/src/Twig/SecurityPolicy/ForbiddenPolicy.php index 7c60522b..cab45ce9 100644 --- a/src/Twig/SecurityPolicy/ForbiddenPolicy.php +++ b/src/Twig/SecurityPolicy/ForbiddenPolicy.php @@ -51,19 +51,19 @@ final class ForbiddenPolicy implements SecurityPolicyInterface { foreach ($tags as $tag) { if (\in_array($tag, $this->forbiddenTags)) { - throw new SecurityNotAllowedTagError(sprintf('Tag "%s" is not allowed.', $tag), $tag); + throw new SecurityNotAllowedTagError(\sprintf('Tag "%s" is not allowed.', $tag), $tag); } } foreach ($filters as $filter) { if (\in_array($filter, $this->forbiddenFilters)) { - throw new SecurityNotAllowedFilterError(sprintf('Filter "%s" is not allowed.', $filter), $filter); + throw new SecurityNotAllowedFilterError(\sprintf('Filter "%s" is not allowed.', $filter), $filter); } } foreach ($functions as $function) { if (\in_array($function, $this->forbiddenFunctions)) { - throw new SecurityNotAllowedFunctionError(sprintf('Function "%s" is not allowed.', $function), $function); + throw new SecurityNotAllowedFunctionError(\sprintf('Function "%s" is not allowed.', $function), $function); } } } @@ -86,7 +86,7 @@ final class ForbiddenPolicy implements SecurityPolicyInterface if ($forbidden) { $class = \get_class($obj); - throw new SecurityNotAllowedMethodError(sprintf('Calling "%s" method on a "%s" object is not allowed.', $method, $class), $class, $method); + throw new SecurityNotAllowedMethodError(\sprintf('Calling "%s" method on a "%s" object is not allowed.', $method, $class), $class, $method); } } @@ -103,7 +103,7 @@ final class ForbiddenPolicy implements SecurityPolicyInterface if ($forbidden) { $class = \get_class($obj); - throw new SecurityNotAllowedPropertyError(sprintf('Calling "%s" property on a "%s" object is not allowed.', $property, $class), $class, $property); + throw new SecurityNotAllowedPropertyError(\sprintf('Calling "%s" property on a "%s" object is not allowed.', $property, $class), $class, $property); } } } diff --git a/src/User/UserService.php b/src/User/UserService.php index d4678dec..1852a240 100644 --- a/src/User/UserService.php +++ b/src/User/UserService.php @@ -136,7 +136,7 @@ class UserService $user = $this->findUserByName($username); if ($user === null) { - throw new \InvalidArgumentException(sprintf('User identified by "%s" username does not exist.', $username)); + throw new \InvalidArgumentException(\sprintf('User identified by "%s" username does not exist.', $username)); } return $user; diff --git a/src/Utils/Color.php b/src/Utils/Color.php index 7f02ea7b..7ee3f924 100644 --- a/src/Utils/Color.php +++ b/src/Utils/Color.php @@ -96,7 +96,7 @@ final class Color public function getRandomColor(): string { - return sprintf('#%06x', rand(0, 16777215)); + return \sprintf('#%06x', rand(0, 16777215)); } public function getRandomFromPalette(string $input): string diff --git a/src/Utils/Duration.php b/src/Utils/Duration.php index 81a75ab6..c6914379 100644 --- a/src/Utils/Duration.php +++ b/src/Utils/Duration.php @@ -85,7 +85,7 @@ final class Duration self::FORMAT_COLON => $this->parseColonFormat($duration), self::FORMAT_NATURAL => $this->parseNaturalFormat($duration), self::FORMAT_DECIMAL => $this->parseDecimalFormat($duration), - default => throw new \InvalidArgumentException(sprintf('Unsupported duration format "%s"', $mode)), + default => throw new \InvalidArgumentException(\sprintf('Unsupported duration format "%s"', $mode)), }; } @@ -116,7 +116,7 @@ final class Duration $parts = explode(':', $duration); if (\count($parts) < 2 || \count($parts) > 3) { throw new \InvalidArgumentException( - sprintf('Invalid colon format given in "%s"', $duration) + \sprintf('Invalid colon format given in "%s"', $duration) ); } @@ -124,13 +124,13 @@ final class Duration foreach ($parts as $part) { if (\strlen($part) === 0) { throw new \InvalidArgumentException( - sprintf('Colon format cannot parse "%s"', $duration) + \sprintf('Colon format cannot parse "%s"', $duration) ); } // the entire time could be negative if ($i++ > 0 && ((int) $part) < 0) { throw new \InvalidArgumentException( - sprintf('Negative input is not allowed in "%s"', $duration) + \sprintf('Negative input is not allowed in "%s"', $duration) ); } } diff --git a/src/Utils/FileHelper.php b/src/Utils/FileHelper.php index b3b92989..9b6898a2 100644 --- a/src/Utils/FileHelper.php +++ b/src/Utils/FileHelper.php @@ -40,11 +40,11 @@ final class FileHelper $this->makeDir($directory); if (!is_dir($directory)) { - throw new \Exception(sprintf('Directory "%s" does not exist', $directory)); + throw new \Exception(\sprintf('Directory "%s" does not exist', $directory)); } if (!is_writable($directory)) { - throw new \Exception(sprintf('Directory "%s" is not writable', $directory)); + throw new \Exception(\sprintf('Directory "%s" is not writable', $directory)); } return $directory; diff --git a/src/Utils/PaginationTemplate.php b/src/Utils/PaginationTemplate.php index 61a537f6..2279802f 100644 --- a/src/Utils/PaginationTemplate.php +++ b/src/Utils/PaginationTemplate.php @@ -39,9 +39,9 @@ final class PaginationTemplate extends TwitterBootstrap5Template protected function linkLi(string $class, string $href, $text, ?string $rel = null): string { $liClass = implode(' ', array_filter(['page-item', $class])); - $rel = $rel ? sprintf(' rel="%s"', $rel) : ''; + $rel = $rel ? \sprintf(' rel="%s"', $rel) : ''; - return sprintf('
  • %s
  • ', $liClass, $href, $rel, $text); + return \sprintf('
  • %s
  • ', $liClass, $href, $rel, $text); } /** @@ -53,7 +53,7 @@ final class PaginationTemplate extends TwitterBootstrap5Template { $liClass = implode(' ', array_filter(['page-item', $class])); - return sprintf('
  • %s
  • ', $liClass, $text); + return \sprintf('
  • %s
  • ', $liClass, $text); } public function current(int $page): string diff --git a/src/Widget/Type/AbstractWidget.php b/src/Widget/Type/AbstractWidget.php index bd005f25..6dd92d1e 100644 --- a/src/Widget/Type/AbstractWidget.php +++ b/src/Widget/Type/AbstractWidget.php @@ -130,6 +130,6 @@ abstract class AbstractWidget implements WidgetInterface { $name = (new \ReflectionClass($this))->getShortName(); - return sprintf('widget/widget-%s.html.twig', strtolower($name)); + return \sprintf('widget/widget-%s.html.twig', strtolower($name)); } } diff --git a/src/Widget/Type/PaginatedWorkingTimeChart.php b/src/Widget/Type/PaginatedWorkingTimeChart.php index 116921b1..922e2191 100644 --- a/src/Widget/Type/PaginatedWorkingTimeChart.php +++ b/src/Widget/Type/PaginatedWorkingTimeChart.php @@ -128,8 +128,8 @@ final class PaginatedWorkingTimeChart extends AbstractWidget $monthBegin = (clone $weekBegin)->setDate((int) $weekBegin->format('Y'), (int) $weekBegin->format('n'), 1)->setTime(0, 0, 0); $monthEnd = (clone $weekBegin)->setDate((int) $weekBegin->format('Y'), (int) $weekBegin->format('n'), (int) $weekBegin->format('t'))->setTime(23, 59, 59); - $yearBegin = $dateTimeFactory->createDateTime(sprintf('01 january %s 00:00:00', $year)); - $yearEnd = $dateTimeFactory->createDateTime(sprintf('31 december %s 23:59:59', $year)); + $yearBegin = $dateTimeFactory->createDateTime(\sprintf('01 january %s 00:00:00', $year)); + $yearEnd = $dateTimeFactory->createDateTime(\sprintf('31 december %s 23:59:59', $year)); $yearData = $this->repository->getDurationForTimeRange($yearBegin, $yearEnd, $user); $financialYearData = null; diff --git a/src/Widget/WidgetService.php b/src/Widget/WidgetService.php index fcddd07d..0bcfc5ca 100644 --- a/src/Widget/WidgetService.php +++ b/src/Widget/WidgetService.php @@ -41,7 +41,7 @@ class WidgetService public function getWidget(string $id): WidgetInterface { if (!$this->hasWidget($id)) { - throw new \InvalidArgumentException(sprintf('Cannot find widget: %s', $id)); + throw new \InvalidArgumentException(\sprintf('Cannot find widget: %s', $id)); } return $this->widgets[$id]; diff --git a/tests/API/APIControllerBaseTest.php b/tests/API/APIControllerBaseTest.php index fcf78879..f7aeee3c 100644 --- a/tests/API/APIControllerBaseTest.php +++ b/tests/API/APIControllerBaseTest.php @@ -39,7 +39,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest User::ROLE_ADMIN => self::createClient([], $this->getAuthHeader(UserFixtures::USERNAME_ADMIN, UserFixtures::DEFAULT_API_TOKEN . '_admin')), User::ROLE_TEAMLEAD => self::createClient([], $this->getAuthHeader(UserFixtures::USERNAME_TEAMLEAD, UserFixtures::DEFAULT_API_TOKEN . '_teamlead')), User::ROLE_USER => self::createClient([], $this->getAuthHeader(UserFixtures::USERNAME_USER, UserFixtures::DEFAULT_API_TOKEN . '_user')), - default => throw new \Exception(sprintf('Unknown role "%s"', $role)), + default => throw new \Exception(\sprintf('Unknown role "%s"', $role)), }; } @@ -74,13 +74,13 @@ abstract class APIControllerBaseTest extends ControllerBaseTest self::assertEquals( $data, json_decode($response->getContent(), true), - sprintf('The secure URL %s is not protected.', $url) + \sprintf('The secure URL %s is not protected.', $url) ); self::assertEquals( Response::HTTP_UNAUTHORIZED, $response->getStatusCode(), - sprintf('The secure URL %s has the wrong status code %s.', $url, $response->getStatusCode()) + \sprintf('The secure URL %s has the wrong status code %s.', $url, $response->getStatusCode()) ); } @@ -91,7 +91,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest self::assertFalse( $client->getResponse()->isSuccessful(), - sprintf('The secure URL %s is not protected for role %s', $url, $role) + \sprintf('The secure URL %s is not protected for role %s', $url, $role) ); $this->assertApiException($client->getResponse(), [ @@ -248,7 +248,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest while (stripos($fieldName, '.') !== false) { $parts = explode('.', $fieldName); $tmp = array_shift($parts); - self::assertArrayHasKey($tmp, $data, sprintf('Could not find field "%s" in result', $tmp)); + self::assertArrayHasKey($tmp, $data, \sprintf('Could not find field "%s" in result', $tmp)); $data = $data[$tmp]; if (\count($data) === 1 && \array_key_exists('children', $data)) { $data = $data['children']; @@ -256,8 +256,8 @@ abstract class APIControllerBaseTest extends ControllerBaseTest $fieldName = implode('.', $parts); } - self::assertArrayHasKey($fieldName, $data, sprintf('Could not find validation error for field "%s" in list: %s', $fieldName, implode(', ', $failedFields))); - self::assertArrayHasKey('errors', $data[$fieldName], sprintf('Field %s has no validation problem', $fieldName)); + self::assertArrayHasKey($fieldName, $data, \sprintf('Could not find validation error for field "%s" in list: %s', $fieldName, implode(', ', $failedFields))); + self::assertArrayHasKey('errors', $data[$fieldName], \sprintf('Field %s has no validation problem', $fieldName)); foreach ($messages as $i => $message) { self::assertEquals($message, $data[$fieldName]['errors'][$i]); } @@ -648,7 +648,7 @@ abstract class APIControllerBaseTest extends ControllerBaseTest ]; default: - throw new \Exception(sprintf('Unknown API response type: %s', $type)); + throw new \Exception(\sprintf('Unknown API response type: %s', $type)); } } @@ -668,12 +668,12 @@ abstract class APIControllerBaseTest extends ControllerBaseTest sort($actual); sort($expectedKeys); - self::assertEquals($expectedKeys, $actual, sprintf('Structure for API response type "%s" does not match', $type)); + self::assertEquals($expectedKeys, $actual, \sprintf('Structure for API response type "%s" does not match', $type)); self::assertEquals( \count($actual), \count($expectedKeys), - sprintf('Mismatch between expected and result keys for API response type "%s". Expected %s keys but found %s.', $type, \count($expected), \count($actual)) + \sprintf('Mismatch between expected and result keys for API response type "%s". Expected %s keys but found %s.', $type, \count($expected), \count($actual)) ); foreach ($expected as $key => $value) { @@ -706,13 +706,13 @@ abstract class APIControllerBaseTest extends ControllerBaseTest $value['type'] = substr($value['type'], 1); } - self::assertIsArray($result[$key], sprintf('Key "%s" in type "%s" is not an array', $key, $type)); + self::assertIsArray($result[$key], \sprintf('Key "%s" in type "%s" is not an array', $key, $type)); self::assertApiResponseTypeStructure($value['type'], $result[$key]); break; default: - throw new \Exception(sprintf('Invalid result type "%s" for subresource given', $value['result'])); + throw new \Exception(\sprintf('Invalid result type "%s" for subresource given', $value['result'])); } continue; @@ -727,18 +727,18 @@ abstract class APIControllerBaseTest extends ControllerBaseTest if (strtolower($value) === 'datetime') { $date = \DateTime::createFromFormat('Y-m-d\TH:i:sO', $result[$key]); - self::assertInstanceOf(\DateTime::class, $date, sprintf('Field "%s" was expected to be a Date with the format "Y-m-dTH:i:sO", but found: %s', $key, $result[$key])); + self::assertInstanceOf(\DateTime::class, $date, \sprintf('Field "%s" was expected to be a Date with the format "Y-m-dTH:i:sO", but found: %s', $key, $result[$key])); $value = 'string'; } elseif (strtolower($value) === 'date') { $date = \DateTime::createFromFormat('Y-m-d', $result[$key]); - self::assertInstanceOf(\DateTime::class, $date, sprintf('Field "%s" was expected to be a Date with the format "Y-m-d", but found: %s', $key, $result[$key])); + self::assertInstanceOf(\DateTime::class, $date, \sprintf('Field "%s" was expected to be a Date with the format "Y-m-d", but found: %s', $key, $result[$key])); $value = 'string'; } static::assertThat( $result[$key], new IsType($value), - sprintf('Found type mismatch in structure for API response type %s. Expected type "%s" for key "%s".', $type, $value, $key) + \sprintf('Found type mismatch in structure for API response type %s. Expected type "%s" for key "%s".', $type, $value, $key) ); } } diff --git a/tests/API/ActionsControllerTest.php b/tests/API/ActionsControllerTest.php index a90d9f0f..afcb85f1 100644 --- a/tests/API/ActionsControllerTest.php +++ b/tests/API/ActionsControllerTest.php @@ -55,7 +55,7 @@ class ActionsControllerTest extends APIControllerBaseTest ]; foreach ($views as $view => $entries) { - $this->assertAccessIsGranted($client, sprintf('/api/actions/timesheet/%s/%s/en', $items[0]->getId(), $view)); + $this->assertAccessIsGranted($client, \sprintf('/api/actions/timesheet/%s/%s/en', $items[0]->getId(), $view)); $result = json_decode($client->getResponse()->getContent(), true); $this->assertIsArray($result); @@ -65,7 +65,7 @@ class ActionsControllerTest extends APIControllerBaseTest $i = 0; foreach ($entries as $id) { - self::assertEquals($id, $result[$i]['id'], sprintf('Failed action "%s" with name "%s" in view "%s"', $i, $id, $view)); + self::assertEquals($id, $result[$i]['id'], \sprintf('Failed action "%s" with name "%s" in view "%s"', $i, $id, $view)); $i++; } } @@ -105,7 +105,7 @@ class ActionsControllerTest extends APIControllerBaseTest ]; foreach ($views as $view => $entries) { - $this->assertAccessIsGranted($client, sprintf('/api/actions/activity/%s/%s/en', $activities[0]->getId(), $view)); + $this->assertAccessIsGranted($client, \sprintf('/api/actions/activity/%s/%s/en', $activities[0]->getId(), $view)); $result = json_decode($client->getResponse()->getContent(), true); $this->assertIsArray($result); @@ -115,7 +115,7 @@ class ActionsControllerTest extends APIControllerBaseTest $i = 0; foreach ($entries as $id) { - self::assertEquals($id, $result[$i]['id'], sprintf('Failed action "%s" with name "%s" in view "%s"', $i, $id, $view)); + self::assertEquals($id, $result[$i]['id'], \sprintf('Failed action "%s" with name "%s" in view "%s"', $i, $id, $view)); $i++; } } @@ -154,7 +154,7 @@ class ActionsControllerTest extends APIControllerBaseTest ]; foreach ($views as $view => $entries) { - $this->assertAccessIsGranted($client, sprintf('/api/actions/project/%s/%s/en', $projects[0]->getId(), $view)); + $this->assertAccessIsGranted($client, \sprintf('/api/actions/project/%s/%s/en', $projects[0]->getId(), $view)); $result = json_decode($client->getResponse()->getContent(), true); $this->assertIsArray($result); @@ -164,7 +164,7 @@ class ActionsControllerTest extends APIControllerBaseTest $i = 0; foreach ($entries as $id) { - self::assertEquals($id, $result[$i]['id'], sprintf('Failed action "%s" with name "%s" in view "%s"', $i, $id, $view)); + self::assertEquals($id, $result[$i]['id'], \sprintf('Failed action "%s" with name "%s" in view "%s"', $i, $id, $view)); $i++; } } @@ -199,7 +199,7 @@ class ActionsControllerTest extends APIControllerBaseTest ]; foreach ($views as $view => $entries) { - $this->assertAccessIsGranted($client, sprintf('/api/actions/customer/%s/%s/en', $customers[0]->getId(), $view)); + $this->assertAccessIsGranted($client, \sprintf('/api/actions/customer/%s/%s/en', $customers[0]->getId(), $view)); $result = json_decode($client->getResponse()->getContent(), true); $this->assertIsArray($result); @@ -209,7 +209,7 @@ class ActionsControllerTest extends APIControllerBaseTest $i = 0; foreach ($entries as $id) { - self::assertEquals($id, $result[$i]['id'], sprintf('Failed action "%s" with name "%s" in view "%s"', $i, $id, $view)); + self::assertEquals($id, $result[$i]['id'], \sprintf('Failed action "%s" with name "%s" in view "%s"', $i, $id, $view)); $i++; } } diff --git a/tests/API/ActivityControllerTest.php b/tests/API/ActivityControllerTest.php index a8217767..a9f4066d 100644 --- a/tests/API/ActivityControllerTest.php +++ b/tests/API/ActivityControllerTest.php @@ -46,10 +46,10 @@ class ActivityControllerTest extends APIControllerBaseTest protected function getRateUrl($id = '1', $rateId = null): string { if (null !== $rateId) { - return sprintf('/api/activities/%s/rates/%s', $id, $rateId); + return \sprintf('/api/activities/%s/rates/%s', $id, $rateId); } - return sprintf('/api/activities/%s/rates', $id); + return \sprintf('/api/activities/%s/rates', $id); } protected function importTestRates($id): array diff --git a/tests/API/ApiDocControllerTest.php b/tests/API/ApiDocControllerTest.php index 6c929d17..98c3b943 100644 --- a/tests/API/ApiDocControllerTest.php +++ b/tests/API/ApiDocControllerTest.php @@ -26,7 +26,7 @@ class ApiDocControllerTest extends ControllerBaseTest { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $this->assertAccessIsGranted($client, '/api/doc'); - $this->assertStringContainsString('Kimai - API Docs', $client->getResponse()->getContent()); + $this->assertStringContainsString('Kimai', $client->getResponse()->getContent()); $result = $client->getCrawler()->filter('script#swagger-data'); $swaggerJson = json_decode($result->text(), true); $tags = []; @@ -44,7 +44,7 @@ class ApiDocControllerTest extends ControllerBaseTest sort($actual); sort($expectedKeys); - self::assertEquals($expectedKeys, $actual, sprintf('Expected %s sections in API docs, but found %s.', \count($actual), \count($expectedKeys))); + self::assertEquals($expectedKeys, $actual, \sprintf('Expected %s sections in API docs, but found %s.', \count($actual), \count($expectedKeys))); } public function testGetJsonDocs(): void @@ -105,7 +105,7 @@ class ApiDocControllerTest extends ControllerBaseTest $this->assertArrayHasKey('openapi', $json); $this->assertEquals('3.0.0', $json['openapi']); $this->assertArrayHasKey('info', $json); - $this->assertEquals('Kimai - API Docs', $json['info']['title']); + $this->assertStringStartsWith('Kimai', $json['info']['title']); $this->assertEquals('1.0', $json['info']['version']); $this->assertArrayHasKey('paths', $json); diff --git a/tests/API/AuthenticationTest.php b/tests/API/AuthenticationTest.php index b0fde843..63efc024 100644 --- a/tests/API/AuthenticationTest.php +++ b/tests/API/AuthenticationTest.php @@ -70,13 +70,13 @@ class AuthenticationTest extends APIControllerBaseTest $this->assertEquals( $data, json_decode($response->getContent(), true), - sprintf('The secure URL %s is not protected.', $url) + \sprintf('The secure URL %s is not protected.', $url) ); $this->assertEquals( Response::HTTP_FORBIDDEN, $response->getStatusCode(), - sprintf('The secure URL %s has the wrong status code %s.', $url, $response->getStatusCode()) + \sprintf('The secure URL %s has the wrong status code %s.', $url, $response->getStatusCode()) ); } diff --git a/tests/API/CustomerControllerTest.php b/tests/API/CustomerControllerTest.php index fab2703c..467a69d3 100644 --- a/tests/API/CustomerControllerTest.php +++ b/tests/API/CustomerControllerTest.php @@ -46,10 +46,10 @@ class CustomerControllerTest extends APIControllerBaseTest protected function getRateUrl($id = '1', $rateId = null): string { if (null !== $rateId) { - return sprintf('/api/customers/%s/rates/%s', $id, $rateId); + return \sprintf('/api/customers/%s/rates/%s', $id, $rateId); } - return sprintf('/api/customers/%s/rates', $id); + return \sprintf('/api/customers/%s/rates', $id); } protected function importTestRates($id): array diff --git a/tests/API/ProjectControllerTest.php b/tests/API/ProjectControllerTest.php index 47e2970b..d6ba97a3 100644 --- a/tests/API/ProjectControllerTest.php +++ b/tests/API/ProjectControllerTest.php @@ -47,10 +47,10 @@ class ProjectControllerTest extends APIControllerBaseTest protected function getRateUrl($id = '1', $rateId = null): string { if (null !== $rateId) { - return sprintf('/api/projects/%s/rates/%s', $id, $rateId); + return \sprintf('/api/projects/%s/rates/%s', $id, $rateId); } - return sprintf('/api/projects/%s/rates', $id); + return \sprintf('/api/projects/%s/rates', $id); } protected function importTestRates($id): array diff --git a/tests/API/TimesheetControllerTest.php b/tests/API/TimesheetControllerTest.php index dd2e1077..722a695f 100644 --- a/tests/API/TimesheetControllerTest.php +++ b/tests/API/TimesheetControllerTest.php @@ -419,7 +419,7 @@ class TimesheetControllerTest extends APIControllerBaseTest ]; foreach ($expected as $key => $value) { - self::assertEquals($value, $result[$key], sprintf('Field %s has invalid value', $key)); + self::assertEquals($value, $result[$key], \sprintf('Field %s has invalid value', $key)); } } diff --git a/tests/Command/ExportCreateCommandTest.php b/tests/Command/ExportCreateCommandTest.php index 7a6a46d6..4916212f 100644 --- a/tests/Command/ExportCreateCommandTest.php +++ b/tests/Command/ExportCreateCommandTest.php @@ -162,12 +162,12 @@ class ExportCreateCommandTest extends KernelTestCase public function testCreateWithInvalidEmail(): void { - $this->assertCommandErrors(['--template' => 'csv', '--email' => ['tzuikmnbgtz']], 'Invalid "email" given: tzuikmnbgtz'); + $this->assertCommandErrors(['--template' => 'csv', '--email' => ['tzuikmnbgtz']], 'Invalid "email" given'); } public function testCreateWithInvalidEmails(): void { - $this->assertCommandErrors(['--template' => 'csv', '--email' => ['foo@example.com', 'foo@1']], 'Invalid "email" given: foo@1'); + $this->assertCommandErrors(['--template' => 'csv', '--email' => ['foo@example.com', 'foo@1']], 'Invalid "email" given'); } public function testCreateWithMissingEntries(): void diff --git a/tests/Command/UpdateCommandTest.php b/tests/Command/UpdateCommandTest.php index fa3fad47..38eb189f 100644 --- a/tests/Command/UpdateCommandTest.php +++ b/tests/Command/UpdateCommandTest.php @@ -54,7 +54,7 @@ class UpdateCommandTest extends KernelTestCase self::assertStringContainsString('[OK] Already at the latest version ("DoctrineMigrations\\', $result); self::assertStringContainsString( - sprintf('[OK] Congratulations! Successfully updated Kimai to version %s', Constants::VERSION), + \sprintf('[OK] Congratulations! Successfully updated Kimai to version %s', Constants::VERSION), $result ); diff --git a/tests/ConsoleApplicationTest.php b/tests/ConsoleApplicationTest.php index bdcfcf38..bbddb036 100644 --- a/tests/ConsoleApplicationTest.php +++ b/tests/ConsoleApplicationTest.php @@ -25,6 +25,6 @@ class ConsoleApplicationTest extends TestCase $sut = new ConsoleApplication($kernel); self::assertEquals(Constants::SOFTWARE, $sut->getName()); self::assertEquals(Constants::VERSION, $sut->getVersion()); - self::assertEquals(sprintf('%s <info>%s</info> (env: <comment></>, debug: <comment>false</>)', Constants::SOFTWARE, Constants::VERSION), $sut->getLongVersion()); + self::assertEquals(\sprintf('%s <info>%s</info> (env: <comment></>, debug: <comment>false</>)', Constants::SOFTWARE, Constants::VERSION), $sut->getLongVersion()); } } diff --git a/tests/Controller/ControllerBaseTest.php b/tests/Controller/ControllerBaseTest.php index 430ed18a..00faee2e 100644 --- a/tests/Controller/ControllerBaseTest.php +++ b/tests/Controller/ControllerBaseTest.php @@ -182,13 +182,13 @@ abstract class ControllerBaseTest extends WebTestCase self::assertTrue( $response->isRedirect(), - sprintf('The secure URL %s is not protected.', $url) + \sprintf('The secure URL %s is not protected.', $url) ); self::assertStringEndsWith( '/login', $response->getTargetUrl(), - sprintf('The secure URL %s does not redirect to the login form.', $url) + \sprintf('The secure URL %s does not redirect to the login form.', $url) ); } @@ -210,7 +210,7 @@ abstract class ControllerBaseTest extends WebTestCase $client->request($method, $this->createUrl($url)); self::assertFalse( $client->getResponse()->isSuccessful(), - sprintf('The secure URL %s is not protected for role %s', $url, $role) + \sprintf('The secure URL %s is not protected for role %s', $url, $role) ); $this->assertAccessDenied($client); } @@ -325,7 +325,7 @@ abstract class ControllerBaseTest extends WebTestCase self::assertEquals( \count($fieldNames), \count($validationErrors), - sprintf('Expected %s validation errors, found %s', \count($fieldNames), \count($validationErrors)) + \sprintf('Expected %s validation errors, found %s', \count($fieldNames), \count($validationErrors)) ); foreach ($fieldNames as $name) { @@ -432,7 +432,7 @@ abstract class ControllerBaseTest extends WebTestCase self::assertNotNull($location); // check for meta refresh - $expectedMeta = sprintf('<meta http-equiv="refresh" content="0;url=\'%1$s\'" />', $location); + $expectedMeta = \sprintf('<meta http-equiv="refresh" content="0;url=\'%1$s\'" />', $location); self::assertStringContainsString($expectedMeta, $client->getResponse()->getContent()); if ($url !== null) { diff --git a/tests/Controller/ProfileControllerTest.php b/tests/Controller/ProfileControllerTest.php index fa664728..9a5c3f1d 100644 --- a/tests/Controller/ProfileControllerTest.php +++ b/tests/Controller/ProfileControllerTest.php @@ -243,7 +243,7 @@ class ProfileControllerTest extends ControllerBaseTest } /** - * @legacy + * @group legacy */ public function testApiTokenAction(): void { diff --git a/tests/Controller/Reporting/AbstractUserPeriodControllerTest.php b/tests/Controller/Reporting/AbstractUserPeriodControllerTest.php index 07714b2e..e9e4d3e2 100644 --- a/tests/Controller/Reporting/AbstractUserPeriodControllerTest.php +++ b/tests/Controller/Reporting/AbstractUserPeriodControllerTest.php @@ -53,8 +53,8 @@ abstract class AbstractUserPeriodControllerTest extends ControllerBaseTest { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->importReportingFixture(User::ROLE_SUPER_ADMIN); - $this->assertAccessIsGranted($client, sprintf('%s?user=%s&date=12999119191&sumType=%s', $this->getReportUrl(), $user, $dataType)); - self::assertStringContainsString(sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent()); + $this->assertAccessIsGranted($client, \sprintf('%s?user=%s&date=12999119191&sumType=%s', $this->getReportUrl(), $user, $dataType)); + self::assertStringContainsString(\sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent()); $option = $client->getCrawler()->filterXPath("//select[@id='user']/option[@selected]"); self::assertEquals($user, $option->attr('value')); $cell = $client->getCrawler()->filterXPath("//th[contains(@class, 'reportDataTypeTitle')]"); @@ -65,8 +65,8 @@ abstract class AbstractUserPeriodControllerTest extends ControllerBaseTest { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $this->importReportingFixture(User::ROLE_USER); - $this->assertAccessIsGranted($client, sprintf('%s?date=12999119191', $this->getReportUrl())); - self::assertStringContainsString(sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent()); + $this->assertAccessIsGranted($client, \sprintf('%s?date=12999119191', $this->getReportUrl())); + self::assertStringContainsString(\sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent()); $select = $client->getCrawler()->filterXPath("//select[@id='user']"); self::assertEquals(0, $select->count()); $cell = $client->getCrawler()->filterXPath("//th[contains(@class, 'reportDataTypeTitle')]"); diff --git a/tests/Controller/Reporting/AbstractUsersPeriodControllerTest.php b/tests/Controller/Reporting/AbstractUsersPeriodControllerTest.php index 800997b5..79f754ec 100644 --- a/tests/Controller/Reporting/AbstractUsersPeriodControllerTest.php +++ b/tests/Controller/Reporting/AbstractUsersPeriodControllerTest.php @@ -56,8 +56,8 @@ abstract class AbstractUsersPeriodControllerTest extends ControllerBaseTest { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->importReportingFixture(User::ROLE_SUPER_ADMIN); - $this->assertAccessIsGranted($client, sprintf('%s?date=12999119191&sumType=%s', $this->getReportUrl(), $dataType)); - self::assertStringContainsString(sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent()); + $this->assertAccessIsGranted($client, \sprintf('%s?date=12999119191&sumType=%s', $this->getReportUrl(), $dataType)); + self::assertStringContainsString(\sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent()); $cell = $client->getCrawler()->filterXPath("//th[contains(@class, 'reportDataTypeTitle')]"); self::assertEquals($title, $cell->text()); } @@ -69,8 +69,8 @@ abstract class AbstractUsersPeriodControllerTest extends ControllerBaseTest { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); $this->importReportingFixture(User::ROLE_TEAMLEAD); - $this->assertAccessIsGranted($client, sprintf('%s?date=12999119191&sumType=%s', $this->getReportUrl(), $dataType)); - self::assertStringContainsString(sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent()); + $this->assertAccessIsGranted($client, \sprintf('%s?date=12999119191&sumType=%s', $this->getReportUrl(), $dataType)); + self::assertStringContainsString(\sprintf('<div class="card-body %s', $this->getBoxId()), $client->getResponse()->getContent()); $select = $client->getCrawler()->filterXPath("//select[@id='user']"); self::assertEquals(0, $select->count()); $cell = $client->getCrawler()->filterXPath("//th[contains(@class, 'reportDataTypeTitle')]"); @@ -84,7 +84,7 @@ abstract class AbstractUsersPeriodControllerTest extends ControllerBaseTest { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->importReportingFixture(User::ROLE_SUPER_ADMIN); - $this->request($client, sprintf('%s?date=12999119191&sumType=%s', $this->getReportExportUrl(), $dataType)); + $this->request($client, \sprintf('%s?date=12999119191&sumType=%s', $this->getReportExportUrl(), $dataType)); $response = $client->getResponse(); $this->assertTrue($response->isSuccessful()); self::assertInstanceOf(BinaryFileResponse::class, $response); diff --git a/tests/Entity/EntityValidationTestTrait.php b/tests/Entity/EntityValidationTestTrait.php index 083cab4b..e179adad 100644 --- a/tests/Entity/EntityValidationTestTrait.php +++ b/tests/Entity/EntityValidationTestTrait.php @@ -52,8 +52,8 @@ trait EntityValidationTestTrait $this->assertTrue($foundField, 'Failed finding violation for field: ' . $propertyPath); } - $this->assertEmpty($violatedFields, sprintf('Unexpected violations found: %s', implode(', ', $violatedFields))); - $this->assertEquals($expected, $countViolations, sprintf('Expected %s violations, found %s in %s.', $expected, $actual, implode(', ', array_keys($violatedFields)))); + $this->assertEmpty($violatedFields, \sprintf('Unexpected violations found: %s', implode(', ', $violatedFields))); + $this->assertEquals($expected, $countViolations, \sprintf('Expected %s violations, found %s in %s.', $expected, $actual, implode(', ', array_keys($violatedFields)))); } public function assertHasNoViolations($entity, $groups = null): void @@ -65,6 +65,6 @@ trait EntityValidationTestTrait $violations = $validator->validate($entity, null, $groups); $actual = $violations->count(); - $this->assertEquals(0, $actual, sprintf('Expected 0 violations, found %s.', $actual)); + $this->assertEquals(0, $actual, \sprintf('Expected 0 violations, found %s.', $actual)); } } diff --git a/tests/Invoice/NumberGenerator/ConfigurableNumberGeneratorTest.php b/tests/Invoice/NumberGenerator/ConfigurableNumberGeneratorTest.php index 7925fe2a..d020f765 100644 --- a/tests/Invoice/NumberGenerator/ConfigurableNumberGeneratorTest.php +++ b/tests/Invoice/NumberGenerator/ConfigurableNumberGeneratorTest.php @@ -238,7 +238,7 @@ class ConfigurableNumberGeneratorTest extends TestCase public function testInvalidGetInvoiceNumber(string $format, \DateTime $invoiceDate, string $brokenPart): void { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf('Unknown %s found', $brokenPart)); + $this->expectExceptionMessage(\sprintf('Unknown %s found', $brokenPart)); $sut = $this->getSut($format); $model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery()); diff --git a/tests/Ldap/LdapManagerTest.php b/tests/Ldap/LdapManagerTest.php index 6710ad9f..f15483d3 100644 --- a/tests/Ldap/LdapManagerTest.php +++ b/tests/Ldap/LdapManagerTest.php @@ -228,7 +228,7 @@ class LdapManagerTest extends TestCase return $expected[1]; } - $this->fail(sprintf('Unexpected search with baseDn %s', $baseDn)); + $this->fail(\sprintf('Unexpected search with baseDn %s', $baseDn)); }); $sut = $this->getLdapManager($driver); @@ -269,7 +269,7 @@ class LdapManagerTest extends TestCase return $expected[1]; } - $this->fail(sprintf('Unexpected search with baseDn %s', $baseDn)); + $this->fail(\sprintf('Unexpected search with baseDn %s', $baseDn)); }); $sut = $this->getLdapManager($driver); @@ -305,7 +305,7 @@ class LdapManagerTest extends TestCase return $expected[1]; } - $this->fail(sprintf('Unexpected search with baseDn %s', $baseDn)); + $this->fail(\sprintf('Unexpected search with baseDn %s', $baseDn)); }); $sut = $this->getLdapManager($driver, [ @@ -445,7 +445,7 @@ class LdapManagerTest extends TestCase return $expectedGroups; } - $this->fail(sprintf('Unexpected search with baseDn %s', $baseDn)); + $this->fail(\sprintf('Unexpected search with baseDn %s', $baseDn)); }); $sut = $this->getLdapManager($driver, $groupConfig); diff --git a/tests/Model/MonthTest.php b/tests/Model/MonthTest.php index 96030822..32bb1999 100644 --- a/tests/Model/MonthTest.php +++ b/tests/Model/MonthTest.php @@ -23,9 +23,9 @@ class MonthTest extends TestCase foreach($months as $key => $days) { $index = ++$key; $monthKey = ($index < 10) ? '0' . $index : $index; - $date = new \DateTimeImmutable(sprintf('2020-%s-25 13:00:00', $monthKey)); + $date = new \DateTimeImmutable(\sprintf('2020-%s-25 13:00:00', $monthKey)); $month = new Month($date); - self::assertEquals(sprintf('2020-%s-25', $monthKey), $month->getMonth()->format('Y-m-d')); + self::assertEquals(\sprintf('2020-%s-25', $monthKey), $month->getMonth()->format('Y-m-d')); self::assertCount($days, $month->getDays()); } } diff --git a/tests/Model/YearTest.php b/tests/Model/YearTest.php index 4077d600..17820155 100644 --- a/tests/Model/YearTest.php +++ b/tests/Model/YearTest.php @@ -27,8 +27,8 @@ class YearTest extends TestCase foreach($months as $key => $days) { $index = ++$key; $monthKey = ($index < 10) ? '0' . $index : $index; - $month = $sut->getMonth(new \DateTimeImmutable(sprintf('2020-%s-13 13:00:00', $monthKey))); - self::assertEquals(sprintf('2020-%s-01', $monthKey), $month->getMonth()->format('Y-m-d')); + $month = $sut->getMonth(new \DateTimeImmutable(\sprintf('2020-%s-13 13:00:00', $monthKey))); + self::assertEquals(\sprintf('2020-%s-01', $monthKey), $month->getMonth()->format('Y-m-d')); self::assertCount($days, $month->getDays()); } } diff --git a/tests/TranslationsTest.php b/tests/TranslationsTest.php index c73f1939..63bc6dae 100644 --- a/tests/TranslationsTest.php +++ b/tests/TranslationsTest.php @@ -36,7 +36,7 @@ class TranslationsTest extends TestCase foreach ($body->children() as $transUnit) { self::assertNotEmpty( (string) $transUnit->target, - sprintf( + \sprintf( 'Found empty translation in language "%s" and file "%s" for key "%s"', $xml->file->attributes()['target-language'], basename($file), @@ -88,14 +88,14 @@ class TranslationsTest extends TestCase // some special cases, which don't work properly - base translation should be changed preg_match_all('/%[a-zA-Z]{1,}%/Uu', (string) $transUnit->target, $matches); asort($matches[0]); - self::assertEquals($transLang[$key], array_values($matches[0]), sprintf('Invalid replacer "%s" in "%s"', $key, basename($file))); + self::assertEquals($transLang[$key], array_values($matches[0]), \sprintf('Invalid replacer "%s" in "%s"', $key, basename($file))); $counter++; unset($transLang[$key]); } } $counter += \count($transLang); - self::assertEquals($expectedCounter, $counter, sprintf('Missing replacer in "%s", did not find translation keys: %s', basename($file), implode(', ', array_keys($transLang)))); + self::assertEquals($expectedCounter, $counter, \sprintf('Missing replacer in "%s", did not find translation keys: %s', basename($file), implode(', ', array_keys($transLang)))); } } } diff --git a/tests/Utils/FormFormatConverterTest.php b/tests/Utils/FormFormatConverterTest.php index 3c2c9f96..677f7bf1 100644 --- a/tests/Utils/FormFormatConverterTest.php +++ b/tests/Utils/FormFormatConverterTest.php @@ -98,7 +98,7 @@ class FormFormatConverterTest extends TestCase $sut = new FormFormatConverter(); foreach ($this->getPossibleDateTimePattern() as $format => $example) { $pattern = $sut->convertToPattern($format, false); - $this->assertMatchesRegularExpression($pattern, $example, sprintf('Invalid pattern %s for format %s, did not match %s', $pattern, $format, $example)); + $this->assertMatchesRegularExpression($pattern, $example, \sprintf('Invalid pattern %s for format %s, did not match %s', $pattern, $format, $example)); } } diff --git a/tests/Voter/CustomerVoterTest.php b/tests/Voter/CustomerVoterTest.php index 397738f5..2d2da701 100644 --- a/tests/Voter/CustomerVoterTest.php +++ b/tests/Voter/CustomerVoterTest.php @@ -27,7 +27,7 @@ class CustomerVoterTest extends AbstractVoterTest $sut = $this->getVoter(CustomerVoter::class); $actual = $sut->vote($token, $subject, [$attribute]); - $this->assertEquals($result, $actual, sprintf('Failed voting "%s" for User with roles %s.', $attribute, implode(', ', $user->getRoles()))); + $this->assertEquals($result, $actual, \sprintf('Failed voting "%s" for User with roles %s.', $attribute, implode(', ', $user->getRoles()))); } public function testVote(): void diff --git a/tests/Voter/ProjectVoterTest.php b/tests/Voter/ProjectVoterTest.php index f4cb948c..55f641bb 100644 --- a/tests/Voter/ProjectVoterTest.php +++ b/tests/Voter/ProjectVoterTest.php @@ -32,7 +32,7 @@ class ProjectVoterTest extends AbstractVoterTest } $actual = $sut->vote($token, $subject, [$attribute]); - $this->assertEquals($result, $actual, sprintf('Failed voting "%s" for User with roles %s.', $attribute, implode(', ', $user->getRoles()))); + $this->assertEquals($result, $actual, \sprintf('Failed voting "%s" for User with roles %s.', $attribute, implode(', ', $user->getRoles()))); } public function testVote(): void diff --git a/tests/Voter/RolePermissionVoterTest.php b/tests/Voter/RolePermissionVoterTest.php index b2d0c7bf..6be11e37 100644 --- a/tests/Voter/RolePermissionVoterTest.php +++ b/tests/Voter/RolePermissionVoterTest.php @@ -29,7 +29,7 @@ class RolePermissionVoterTest extends AbstractVoterTest $sut = $this->getVoter(RolePermissionVoter::class); $actual = $sut->vote($token, $subject, [$attribute]); - $this->assertEquals($result, $actual, sprintf('Failed voting "%s" for User with roles %s.', $attribute, implode(', ', $user->getRoles()))); + $this->assertEquals($result, $actual, \sprintf('Failed voting "%s" for User with roles %s.', $attribute, implode(', ', $user->getRoles()))); } public function getTestData() diff --git a/tests/WorkingTime/Model/MonthTest.php b/tests/WorkingTime/Model/MonthTest.php index 0779fa37..928a1f3a 100644 --- a/tests/WorkingTime/Model/MonthTest.php +++ b/tests/WorkingTime/Model/MonthTest.php @@ -29,9 +29,9 @@ class MonthTest extends TestCase foreach($months as $key => $days) { $index = ++$key; $monthKey = ($index < 10) ? '0' . $index : $index; - $date = new \DateTimeImmutable(sprintf('2020-%s-25 13:00:00', $monthKey)); + $date = new \DateTimeImmutable(\sprintf('2020-%s-25 13:00:00', $monthKey)); $month = new Month($date, $user); - self::assertEquals(sprintf('2020-%s-25', $monthKey), $month->getMonth()->format('Y-m-d')); + self::assertEquals(\sprintf('2020-%s-25', $monthKey), $month->getMonth()->format('Y-m-d')); self::assertCount($days, $month->getDays()); self::assertFalse($month->isLocked()); self::assertEquals(0, $month->getActualTime());