Refactor Classes for PHP 8.4

This commit is contained in:
2025-05-10 13:03:38 +02:00
parent 6fa6b28af6
commit 85d22d5c06
4 changed files with 14 additions and 16 deletions
@@ -18,11 +18,11 @@ use TorstenHettstedt\TimekeepingApi\Repositories\WorkingHoursRepository;
class WorkingHoursRepositoryTest extends Unit
{
public const EXISTING_DATE = '2020-01-28';
public const EXISTING_INTERVAL = 'PT7H20M';
public const NEW_DATE = '2020-04-01';
public const NEW_INTERVAL = 'PT7H59M';
public const RECORDS_COUNT = 61;
public const string EXISTING_DATE = '2020-01-28';
public const string EXISTING_INTERVAL = 'PT7H20M';
public const string NEW_DATE = '2020-04-01';
public const string NEW_INTERVAL = 'PT7H59M';
public const int RECORDS_COUNT = 61;
protected PDO $pdoObject;
@@ -6,7 +6,6 @@ use Codeception\Attribute\DataProvider;
use Codeception\Test\Unit;
use DateTime;
use DateTimeZone;
use Exception;
use PDO;use TorstenHettstedt\TimekeepingApi\Models\WorkingHoursView;
use TorstenHettstedt\TimekeepingApi\Repositories\RepositoryRecordNotFoundException;
use TorstenHettstedt\TimekeepingApi\Repositories\WorkingHoursWeeklyViewRepository;
@@ -38,14 +37,13 @@ class WorkingHoursViewRepositoryTest extends Unit
/**
* @return array<array{string, string, int, DateTime}>
* @throws Exception
*/
public function existingObjectProvider(): array
{
return [
[WorkingHoursYearlyViewRepository::class, '2020', 61, new DateTime('2020-01-01', new DateTimeZone('UCT'))],
[WorkingHoursMonthlyViewRepository::class, '2020 February', 20, new DateTime('2020-02-01', new DateTimeZone('UCT'))],
[WorkingHoursWeeklyViewRepository::class, '2020#03', 5, new DateTime('2020-01-13', new DateTimeZone('UCT'))],
[WorkingHoursYearlyViewRepository::class, '2020', 61, date_create('2020-01-01', new DateTimeZone('UCT'))],
[WorkingHoursMonthlyViewRepository::class, '2020 February', 20, date_create('2020-02-01', new DateTimeZone('UCT'))],
[WorkingHoursWeeklyViewRepository::class, '2020#03', 5, date_create('2020-01-13', new DateTimeZone('UCT'))],
];
}