-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
356c691
commit befa852
Showing
60 changed files
with
918 additions
and
1,007 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Dto\Collection; | ||
|
||
use App\Collection\CollectionInterface; | ||
|
||
interface CollectionRequestInterface | ||
{ | ||
public function createCollection(): CollectionInterface; | ||
} |
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,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Dto\Collection; | ||
|
||
use App\Collection\CollectionInterface; | ||
use App\Collection\PetCollection; | ||
|
||
final class PetCollectionRequest implements CollectionRequestInterface | ||
{ | ||
public int $offset; | ||
|
||
public int $limit; | ||
|
||
/** | ||
* @var array<string, string> | ||
*/ | ||
public array $filters; | ||
|
||
/** | ||
* @var array<string, string> | ||
*/ | ||
public array $sort; | ||
|
||
public function createCollection(): CollectionInterface | ||
{ | ||
$collection = new PetCollection(); | ||
$collection->setOffset($this->offset); | ||
$collection->setLimit($this->limit); | ||
$collection->setFilters($this->filters); | ||
$collection->setSort($this->sort); | ||
|
||
return $collection; | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Dto\Collection; | ||
|
||
final class PetCollectionResponse | ||
{ | ||
public int $offset; | ||
|
||
public int $limit; | ||
|
||
/** | ||
* @var array<string, string> | ||
*/ | ||
public array $filters; | ||
|
||
/** | ||
* @var array<string, string> | ||
*/ | ||
public array $sort; | ||
|
||
public PetCollectionResponseEmbedded $_embedded; | ||
|
||
public int $count; | ||
|
||
/** | ||
* @var array<string, LinkResponse> | ||
*/ | ||
public array $_links; | ||
} |
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\Dto\Collection; | ||
|
||
final class PetCollectionResponseEmbedded | ||
{ | ||
/** | ||
* @var array<PetResponse> | ||
*/ | ||
public array $items; | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Dto; | ||
|
||
final class LinkResponse | ||
{ | ||
public string $href; | ||
|
||
public bool $templated; | ||
|
||
/** | ||
* @var array<string> | ||
*/ | ||
public array $rel; | ||
|
||
/** | ||
* @var array<string, string> | ||
*/ | ||
public array $attributes; | ||
} |
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,14 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Dto\Model; | ||
|
||
use App\Model\ModelInterface; | ||
|
||
interface ModelRequestInterface | ||
{ | ||
public function createModel(): ModelInterface; | ||
|
||
public function updateModel(ModelInterface $model): ModelInterface; | ||
} |
Oops, something went wrong.