Skip to content

Instantly share code, notes, and snippets.

@thiagocordeiro
Last active July 2, 2020 15:01
Show Gist options
  • Save thiagocordeiro/c9ca2a7aa6d554c2efafb0d5066edbf9 to your computer and use it in GitHub Desktop.
Save thiagocordeiro/c9ca2a7aa6d554c2efafb0d5066edbf9 to your computer and use it in GitHub Desktop.
<?php
/**
* @Route('/users', methods={'POST'})
*/
class RegisterUserController
{
private RegisterUserService $service;
public function __construct(RegisterUserService $service) { ... }
public function __invoke(Request $request)
{
$this->service->register( ... );
}
}
/**
* @Route('/users', methods={'GET'})
*/
class GetUserListController
{
private ListUserService $service;
public function __construct(ListUserService $service) { ... }
public function __invoke(Request $request)
{
$this->service->getUserList( ... );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment