This file contains hidden or 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
<?php | |
namespace App\Infrastucture\InMemory; | |
use App\Domain\User; | |
use App\Domain\UserRepositoryInterface; | |
class InMemoryUserRepository implements UserRepositoryInterface | |
{ | |
private User[] $users; |
This file contains hidden or 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
<?php | |
namespace App\Domain; | |
interface UserRepositoryInterface | |
{ | |
public function save(User $user): void; | |
} |
This file contains hidden or 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
<?php | |
namespace App\Domain; | |
final class CreateAUserHandler | |
{ | |
private UserRepositoryInterface $userRepository; | |
public function __construct(UserRepositoryInterface $userRepository) | |
{ |
This file contains hidden or 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
<?php | |
namespace App\Domain; | |
use Symfony\Component\Uid\Uuid; | |
final class User | |
{ | |
private UserId $userId; |
This file contains hidden or 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
<?php | |
namespace App\Domain; | |
final class UserId | |
{ | |
private string $id; | |
public function __construct(string $id) | |
{ |
This file contains hidden or 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
<?php | |
namespace App\Application; | |
use Symfony\Component\Validator\Constraints as Assert; | |
final class CreateAUserPayload | |
{ | |
/** | |
* @Assert\Type(type="string") |
This file contains hidden or 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
<?php | |
namespace App\UserlandTransport; | |
use Symfony\Component\Notifier\Transport\AbstractTransportFactory; | |
use Symfony\Component\Notifier\Transport\Dsn; | |
use Symfony\Component\Notifier\Transport\TransportInterface; | |
class UserlandTransportFactory extends AbstractTransportFactory | |
{ |
This file contains hidden or 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
<?php | |
namespace App\UserlandTransport; | |
use Symfony\Component\Notifier\Message\MessageInterface; | |
use Symfony\Component\Notifier\Message\SentMessage; | |
use Symfony\Component\Notifier\Transport\AbstractTransport; | |
final class UserlandTransport extends AbstractTransport | |
{ |
This file contains hidden or 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
<?php | |
class SandboxController | |
{ | |
/** | |
* @Route("/onboarding", name="onboarding") | |
*/ | |
public function onboarding(NotifierInterface $notifier): Response | |
{ | |
$notification = new Notification('Welcome Aboard', ['chat/slack']); |
This file contains hidden or 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
<?php | |
if (isset([$_GET['id']) && isset([$_GET['limit'])) { | |
// stuff | |
} | |
// can be | |
if (isset($_GET['id'], $_GET['limit']) { | |
// stuff | |
} |