mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix phpstan error courtesy of the laravel 11 upgrade (changed signatures and return types)
This commit is contained in:
@@ -68,6 +68,20 @@ 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();
|
||||
@@ -96,18 +110,4 @@ final class CalculatorTest extends TestCase
|
||||
$period = $calculator->nextDateByInterval($provider->epoch(), $provider->periodicity, $provider->skip);
|
||||
self::assertSame($provider->expected()->toDateString(), $period->toDateString());
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -77,15 +77,6 @@ final class NavigationEndOfPeriodTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideDates
|
||||
*/
|
||||
public function testGivenADateAndFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void
|
||||
{
|
||||
$period = clone $this->navigation->endOfPeriod($from, $frequency);
|
||||
self::assertSame($expected->toDateString(), $period->toDateString());
|
||||
}
|
||||
|
||||
public static function provideUnknownFrequencies(): iterable
|
||||
{
|
||||
return [
|
||||
@@ -95,6 +86,15 @@ final class NavigationEndOfPeriodTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideDates
|
||||
*/
|
||||
public function testGivenADateAndFrequencyWhenCalculateTheDateThenReturnsTheExpectedDateSuccessful(string $frequency, Carbon $from, Carbon $expected): void
|
||||
{
|
||||
$period = clone $this->navigation->endOfPeriod($from, $frequency);
|
||||
self::assertSame($expected->toDateString(), $period->toDateString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideUnknownFrequencies
|
||||
*/
|
||||
|
Reference in New Issue
Block a user