Skip to content

Commit

Permalink
Psalm and CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matt committed Oct 25, 2023
1 parent a201359 commit 900032e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Hydrator/DateIntervalHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace Kynx\Mezzio\OpenApi\Hydrator;

use DateInterval;

use Exception;
use Kynx\Mezzio\OpenApi\Hydrator\Exception\ExtractionException;
use Kynx\Mezzio\OpenApi\Hydrator\Exception\HydrationException;

use function assert;
use function current;
use function is_array;
use function is_string;

/**
Expand Down Expand Up @@ -102,4 +102,4 @@ private static function getDesignatorValue(

return $value . $designator;
}
}
}
10 changes: 9 additions & 1 deletion test/Hydrator/DateIntervalHydratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Kynx\Mezzio\OpenApi\Hydrator\Exception\ExtractionException;
use Kynx\Mezzio\OpenApi\Hydrator\Exception\HydrationException;
use PHPUnit\Framework\TestCase;
use stdClass;

/**
* @covers \Kynx\Mezzio\OpenApi\Hydrator\DateIntervalHydrator
Expand All @@ -25,6 +24,9 @@ public function testHydrateReturnsValidDateInterval(mixed $duration, DateInterva
self::assertEquals($expected, $actual);
}

/**
* @return array<string, array{0: string|list<string>, 1: DateInterval}>
*/
public static function durationProvider(): array
{
return [
Expand All @@ -49,6 +51,9 @@ public function testExtractInvalidDateIntervalThrowsException(mixed $interval, s
DateIntervalHydrator::extract($interval);
}

/**
* @return array<string, array{0: string|DateInterval, 1: string}>
*/
public static function invalidIntervalProvider(): array
{
$inverted = new DateInterval('P1Y');
Expand All @@ -75,6 +80,9 @@ public function testExtractReturnsDuration(string $interval): void
self::assertEquals($interval, $actual);
}

/**
* @return array<string, array{0: string}>
*/
public static function validIntervalProvider(): array
{
return [
Expand Down

0 comments on commit 900032e

Please sign in to comment.