php cs cleanup

This commit is contained in:
James Cole
2025-02-23 12:28:43 +01:00
parent de8149137a
commit 25ebfd6978
16 changed files with 226 additions and 226 deletions

View File

@@ -50,6 +50,32 @@ use Tests\unit\Support\Calendar\Periodicity\YearlyTest;
*/
final class CalculatorTest extends TestCase
{
private static function convert(Periodicity $periodicity, array $intervals): array
{
$periodicityIntervals = [];
/** @var IntervalProvider $interval */
foreach ($intervals as $index => $interval) {
$calculator = CalculatorProvider::from($periodicity, $interval);
$periodicityIntervals["#{$index} {$calculator->label}"] = [$calculator];
}
return $periodicityIntervals;
}
/**
* @dataProvider provideAllPeriodicity
*
* @throws IntervalException
*/
public function testGivenADailyPeriodicityWhenCallTheNextDateByIntervalMethodThenReturnsTheExpectedDateSuccessful(CalculatorProvider $provider): void
{
$calculator = new Calculator();
$period = $calculator->nextDateByInterval($provider->epoch(), $provider->periodicity);
self::assertSame($provider->expected()->toDateString(), $period->toDateString());
}
public static function provideAllPeriodicity(): iterable
{
$intervals = [];
@@ -68,37 +94,6 @@ final class CalculatorTest extends TestCase
}
}
private static function convert(Periodicity $periodicity, array $intervals): array
{
$periodicityIntervals = [];
/** @var IntervalProvider $interval */
foreach ($intervals as $index => $interval) {
$calculator = CalculatorProvider::from($periodicity, $interval);
$periodicityIntervals["#{$index} {$calculator->label}"] = [$calculator];
}
return $periodicityIntervals;
}
public static function provideSkippedIntervals(): iterable
{
return CalculatorProvider::providePeriodicityWithSkippedIntervals();
}
/**
* @dataProvider provideAllPeriodicity
*
* @throws IntervalException
*/
public function testGivenADailyPeriodicityWhenCallTheNextDateByIntervalMethodThenReturnsTheExpectedDateSuccessful(CalculatorProvider $provider): void
{
$calculator = new Calculator();
$period = $calculator->nextDateByInterval($provider->epoch(), $provider->periodicity);
self::assertSame($provider->expected()->toDateString(), $period->toDateString());
}
/**
* @dataProvider provideSkippedIntervals
*
@@ -110,4 +105,9 @@ final class CalculatorTest extends TestCase
$period = $calculator->nextDateByInterval($provider->epoch(), $provider->periodicity, $provider->skip);
self::assertSame($provider->expected()->toDateString(), $period->toDateString());
}
public static function provideSkippedIntervals(): iterable
{
return CalculatorProvider::providePeriodicityWithSkippedIntervals();
}
}