Skip to content

Commit

Permalink
Merge pull request #27 from oat-sa/develop
Browse files Browse the repository at this point in the history
Added findAll() method to the RegistrationRepositoryInterface
  • Loading branch information
ekkinox authored May 10, 2020
2 parents b6d1e06 + 11e7dea commit 12b665b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

1.1.0
-----

* Added `findAll()` method to `RegistrationRepositoryInterface`

1.0.0
-----

Expand Down
5 changes: 5 additions & 0 deletions doc/quickstart/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ $registrationRepository = new class implements RegistrationRepositoryInterface
// TODO: Implement find() method to find a registration by identifier, or null if not found.
}

public function findAll(): array
{
// TODO: Implement findAll() method to find all available registrations.
}

public function findByClientId(string $clientId) : ?RegistrationInterface
{
// TODO: Implement findByClientId() method to find a registration by client id, or null if not found.
Expand Down
3 changes: 3 additions & 0 deletions src/Registration/RegistrationRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ interface RegistrationRepositoryInterface
{
public function find(string $identifier): ?RegistrationInterface;

/** @return RegistrationInterface[] */
public function findAll(): array;

public function findByClientId(string $clientId): ?RegistrationInterface;

public function findByPlatformIssuer(string $issuer, string $clientId = null): ?RegistrationInterface;
Expand Down
5 changes: 5 additions & 0 deletions tests/Traits/DomainTestingTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ public function find(string $identifier): ?RegistrationInterface
return $this->registrations[$identifier] ?? null;
}

public function findAll(): array
{
return $this->registrations;
}

public function findByClientId(string $clientId): ?RegistrationInterface
{
foreach ($this->registrations as $registration) {
Expand Down

0 comments on commit 12b665b

Please sign in to comment.