Skip to content

Commit

Permalink
Removed "of object" from the template annotation of the RepositoryInt…
Browse files Browse the repository at this point in the history
…erface (#508)
  • Loading branch information
sicet7 authored Jan 14, 2025
1 parent f2d32fb commit a366d01
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/FactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public function loader(
): LoaderInterface;

/**
* @template TEntity
*
* Create repository associated with given role.
*
* @param non-empty-string|class-string<TEntity> $role
* @return ($role is class-string<TEntity> ? RepositoryInterface<TEntity> : RepositoryInterface<object>)
*/
public function repository(
ORMInterface $orm,
Expand Down
2 changes: 1 addition & 1 deletion src/RepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Defines ability to locate entities based on scope parameters.
*
* @template TEntity of object
* @template TEntity
*/
interface RepositoryInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Implementation/RepositoryProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
final class RepositoryProvider implements RepositoryProviderInterface
{
/** @var array<non-empty-string, RepositoryInterface> */
/** @var array<non-empty-string, RepositoryInterface<object>> */
private array $repositories = [];

public function __construct(
Expand Down
5 changes: 4 additions & 1 deletion src/Service/RepositoryProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
interface RepositoryProviderInterface
{
/**
* @template TEntity of object
*
* Get repository associated with given entity role.
*
* @param non-empty-string $entity
* @param class-string<TEntity>|non-empty-string $entity
* @return ($entity is class-string<TEntity> ? RepositoryInterface<TEntity> : RepositoryInterface<object>)
*/
public function getRepository(string $entity): RepositoryInterface;
}

0 comments on commit a366d01

Please sign in to comment.