diff --git a/src/Presentation/Api/V1/Presenters/Employees/EmployeeShowPresenter.php b/src/Presentation/Api/V1/Presenters/Employees/EmployeeShowPresenter.php index 95d86f8..6a947aa 100644 --- a/src/Presentation/Api/V1/Presenters/Employees/EmployeeShowPresenter.php +++ b/src/Presentation/Api/V1/Presenters/Employees/EmployeeShowPresenter.php @@ -17,6 +17,16 @@ final readonly class EmployeeShowPresenter implements Presenter { Assert::isInstanceOf($output, Output::class); - return EmployeeShowView::fromOutput($output); + return new EmployeeShowView( + id: $output->id, + firstName: $output->firstName, + lastName: $output->lastName, + establishment: $output->establishment, + site: $output->site, + service: $output->service, + startDate: $output->startDate, + endDate: $output->endDate, + plannedEndDate: $output->plannedEndDate, + ); } } diff --git a/src/Presentation/Api/V1/Presenters/Employees/EmployeeShowView.php b/src/Presentation/Api/V1/Presenters/Employees/EmployeeShowView.php index fc1c5ab..2199f56 100644 --- a/src/Presentation/Api/V1/Presenters/Employees/EmployeeShowView.php +++ b/src/Presentation/Api/V1/Presenters/Employees/EmployeeShowView.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace Presentation\Api\V1\Presenters\Employees; -use Application\Arcadia\Usecase\Employees\Find\Output; use Domain\Models\ValueObjects\Employees\ArcadiaEmployeeId; final readonly class EmployeeShowView @@ -21,19 +20,4 @@ final readonly class EmployeeShowView public ?\DateTimeInterface $plannedEndDate, ) { } - - public static function fromOutput(Output $output): self - { - return new self( - id: $output->id, - firstName: $output->firstName, - lastName: $output->lastName, - establishment: $output->establishment, - site: $output->site, - service: $output->service, - startDate: $output->startDate, - endDate: $output->endDate, - plannedEndDate: $output->plannedEndDate, - ); - } } diff --git a/src/Presentation/Api/V1/Presenters/Employees/EmployeesIndexPresenter.php b/src/Presentation/Api/V1/Presenters/Employees/EmployeesIndexPresenter.php index e052118..d8d2376 100644 --- a/src/Presentation/Api/V1/Presenters/Employees/EmployeesIndexPresenter.php +++ b/src/Presentation/Api/V1/Presenters/Employees/EmployeesIndexPresenter.php @@ -17,6 +17,11 @@ final readonly class EmployeesIndexPresenter implements Presenter { Assert::isInstanceOf($output, Output::class); - return EmployeesIndexView::fromOutput($output); + return new EmployeesIndexView( + employees: $output->employees, + total: $output->total, + page: $output->page, + perPage: $output->perPage, + ); } } diff --git a/src/Presentation/Api/V1/Presenters/Employees/EmployeesIndexView.php b/src/Presentation/Api/V1/Presenters/Employees/EmployeesIndexView.php index 3f8c4fe..23afc52 100644 --- a/src/Presentation/Api/V1/Presenters/Employees/EmployeesIndexView.php +++ b/src/Presentation/Api/V1/Presenters/Employees/EmployeesIndexView.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace Presentation\Api\V1\Presenters\Employees; -use Application\Arcadia\Usecase\Employees\FindAll\Output; use Application\Arcadia\Usecase\Employees\FindAll\PaginatedEmployee; use Webmozart\Assert\Assert; @@ -23,14 +22,4 @@ final readonly class EmployeesIndexView Assert::isInstanceOf($employee, PaginatedEmployee::class); } } - - public static function fromOutput(Output $output): self - { - return new self( - employees: $output->employees, - total: $output->total, - page: $output->page, - perPage: $output->perPage, - ); - } } diff --git a/src/Presentation/Api/V1/Presenters/IncoCompositions/IncoCompositionShowPresenter.php b/src/Presentation/Api/V1/Presenters/IncoCompositions/IncoCompositionShowPresenter.php index 645c55a..cb4d118 100644 --- a/src/Presentation/Api/V1/Presenters/IncoCompositions/IncoCompositionShowPresenter.php +++ b/src/Presentation/Api/V1/Presenters/IncoCompositions/IncoCompositionShowPresenter.php @@ -17,6 +17,6 @@ final readonly class IncoCompositionShowPresenter implements Presenter { Assert::isInstanceOf($output, Output::class); - return IncoCompositionShowView::fromOutput($output); + return new IncoCompositionShowView($output); } } diff --git a/src/Presentation/Api/V1/Presenters/IncoCompositions/IncoCompositionShowView.php b/src/Presentation/Api/V1/Presenters/IncoCompositions/IncoCompositionShowView.php index b42607e..a742652 100644 --- a/src/Presentation/Api/V1/Presenters/IncoCompositions/IncoCompositionShowView.php +++ b/src/Presentation/Api/V1/Presenters/IncoCompositions/IncoCompositionShowView.php @@ -12,9 +12,4 @@ final readonly class IncoCompositionShowView public Output $output, ) { } - - public static function fromOutput(Output $output): self - { - return new self($output); - } } diff --git a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsIndexPresenter.php b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsIndexPresenter.php index 3437ec9..ac302a4 100644 --- a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsIndexPresenter.php +++ b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsIndexPresenter.php @@ -17,6 +17,11 @@ final readonly class IncoSheetsIndexPresenter implements Presenter { Assert::isInstanceOf($output, Output::class); - return IncoSheetsIndexView::fromOutput($output); + return new IncoSheetsIndexView( + incoSheets: array_values($output->incoSheets), + total: $output->total, + page: $output->page, + perPage: $output->perPage, + ); } } diff --git a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsIndexView.php b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsIndexView.php index 3b948ca..5d1fb63 100644 --- a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsIndexView.php +++ b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsIndexView.php @@ -4,13 +4,9 @@ declare(strict_types=1); namespace Presentation\Api\V1\Presenters\IncoSheets; -use Application\Arcadia\Usecase\IncoSheets\FindAll\Output; - final readonly class IncoSheetsIndexView { /** - * phpcs:disable Generic.Files.LineLength.TooLong - * * @param (\Application\Arcadia\Usecase\IncoSheets\FindAll\PaginatedIncoSheet|\Application\Arcadia\Usecase\IncoSheets\FindAll\PaginatedShortIncoSheet)[] $incoSheets */ public function __construct( @@ -20,14 +16,4 @@ final readonly class IncoSheetsIndexView public int $perPage, ) { } - - public static function fromOutput(Output $output): self - { - return new self( - incoSheets: array_values($output->incoSheets), - total: $output->total, - page: $output->page, - perPage: $output->perPage, - ); - } } diff --git a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsSearchPresenter.php b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsSearchPresenter.php index 4937e65..0ea9a62 100644 --- a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsSearchPresenter.php +++ b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsSearchPresenter.php @@ -17,6 +17,11 @@ final readonly class IncoSheetsSearchPresenter implements Presenter { Assert::isInstanceOf($output, Output::class); - return IncoSheetsSearchView::fromOutput($output); + return new IncoSheetsSearchView( + incoSheets: $output->incoSheets, + total: $output->total, + page: $output->page, + perPage: $output->perPage, + ); } } diff --git a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsSearchView.php b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsSearchView.php index b0d6d53..1e54bd3 100644 --- a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsSearchView.php +++ b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsSearchView.php @@ -4,8 +4,6 @@ declare(strict_types=1); namespace Presentation\Api\V1\Presenters\IncoSheets; -use Application\Arcadia\Usecase\IncoSheets\Search\Output; - final readonly class IncoSheetsSearchView { /** @@ -21,14 +19,4 @@ final readonly class IncoSheetsSearchView public int $perPage, ) { } - - public static function fromOutput(Output $output): self - { - return new self( - incoSheets: $output->incoSheets, - total: $output->total, - page: $output->page, - perPage: $output->perPage, - ); - } } diff --git a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsShowPresenter.php b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsShowPresenter.php index baa0caf..91fa098 100644 --- a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsShowPresenter.php +++ b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsShowPresenter.php @@ -17,6 +17,6 @@ final readonly class IncoSheetsShowPresenter implements Presenter { Assert::isInstanceOf($output, Output::class); - return IncoSheetsShowView::fromOutput($output); + return new IncoSheetsShowView($output); } } diff --git a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsShowView.php b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsShowView.php index 02347ee..9e6f708 100644 --- a/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsShowView.php +++ b/src/Presentation/Api/V1/Presenters/IncoSheets/IncoSheetsShowView.php @@ -12,9 +12,4 @@ final readonly class IncoSheetsShowView public Output $output, ) { } - - public static function fromOutput(Output $output): self - { - return new self($output); - } }