-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from lartist/refacto
Refactoring
- Loading branch information
Showing
41 changed files
with
111 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
controllers: | ||
resource: | ||
path: ../src/Shared/Controller/ | ||
namespace: App\Shared\Controller | ||
path: ../src/Shared/Infrastructure/Controller/ | ||
namespace: App\Shared\Infrastructure\Controller | ||
type: attribute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
src/PullRequest/Domain/Gateway/CommitterRepositoryInterface.php
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
src/PullRequest/Infrastructure/Adapter/InMemoryCommitterRepository.php
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
src/PullRequest/Infrastructure/Adapter/RestGithubCommitterRepository.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
src/PullRequestDashboard/Domain/Gateway/CommitterRepositoryInterface.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
src/PullRequestDashboard/Infrastructure/Adapter/InMemoryCommitterRepository.php
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
src/PullRequestDashboard/Infrastructure/Adapter/RestGithubCommitterRepository.php
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
src/Shared/Domain/Gateway/CommitterRepositoryInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Shared\Domain\Gateway; | ||
|
||
interface CommitterRepositoryInterface | ||
{ | ||
/** | ||
* @return string[] | ||
*/ | ||
public function findAll(string $organisation): array; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Shared/Infrastructure/Adapter/InMemoryCommitterRepository.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Shared\Infrastructure\Adapter; | ||
|
||
use App\Shared\Domain\Gateway\CommitterRepositoryInterface; | ||
|
||
class InMemoryCommitterRepository implements CommitterRepositoryInterface | ||
{ | ||
public function findAll(string $organisation): array | ||
{ | ||
return [ | ||
'lartist', | ||
'nicosomb', | ||
]; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Shared/Infrastructure/Adapter/RestGithubCommitterRepository.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Shared\Infrastructure\Adapter; | ||
|
||
use App\Shared\Domain\Gateway\CommitterRepositoryInterface; | ||
use Symfony\Contracts\HttpClient\HttpClientInterface; | ||
|
||
class RestGithubCommitterRepository implements CommitterRepositoryInterface | ||
{ | ||
public function __construct(private readonly HttpClientInterface $githubClient) | ||
{ | ||
} | ||
|
||
public function findAll(string $organisation): array | ||
{ | ||
return array_map( | ||
fn (array $committer) => $committer['login'], | ||
$this->githubClient->request('GET', '/orgs/'.$organisation.'/teams/committers/members')->toArray() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Shared/Command/OnGithubEventCommand.php → ...tructure/Command/OnGithubEventCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.