Skip to content

Commit

Permalink
feat: supports method in proxy query factories
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreyu committed Feb 9, 2024
1 parent 9ad9bbc commit 12f8c02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ class DoctrineOrmProxyQueryFactory implements ProxyQueryFactoryInterface
{
public function create(mixed $data): ProxyQueryInterface
{
if ($data instanceof QueryBuilder) {
return new DoctrineOrmProxyQuery($data);
}
return new DoctrineOrmProxyQuery($data);
}

throw new UnexpectedTypeException($data, QueryBuilder::class);
public function supports(mixed $data): bool
{
return $data instanceof QueryBuilder;
}
}
2 changes: 2 additions & 0 deletions src/Query/ProxyQueryFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
interface ProxyQueryFactoryInterface
{
public function create(mixed $data): ProxyQueryInterface;

public function supports(mixed $data): bool;
}

0 comments on commit 12f8c02

Please sign in to comment.