Skip to content

Commit

Permalink
fix: Collection get schema typehint
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Lelaisant committed Sep 30, 2022
1 parent 5c97ae8 commit d250dcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
final class Collection
{
/**
* @param iterable<JsonSchema<mixed>> $schemas
* @param iterable<JsonSchemaInterface<mixed>> $schemas
*/
public function __construct(private iterable $schemas)
{
}

/**
* @template J of JsonSchema
* @template J of JsonSchemaInterface
*
* @param class-string<J> $schemaClassName
*
* @return J
*/
public function get(string $schemaClassName): JsonSchema
public function get(string $schemaClassName): JsonSchemaInterface
{
foreach ($this->schemas as $schema) {
if (is_a($schema, $schemaClassName)) {
Expand Down

0 comments on commit d250dcb

Please sign in to comment.