Created
September 26, 2016 15:59
-
-
Save anderskitson/c4c130ee31edaadc47d00d72e14869aa to your computer and use it in GitHub Desktop.
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 Acme; | |
class AuthController{ | |
protected $registration; | |
public function __construct(RegisterUser $registration){ | |
$this->registration = $registration; | |
} | |
public function register(){ | |
$this->registration->execute([],$this); | |
} | |
public function userRegisteredSuccessfully(){ | |
var_dump('Created Successfully. Redirect Somewhere'); | |
} | |
public function userRegisteredFailed(){ | |
var_dump('Created Failed. Redirect Back'); | |
} | |
} | |
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 | |
$registration = new Acme\RegisterUser; | |
$authController = new Acme\AuthController($registration); | |
$authController->register(); |
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 Acme; | |
class RegisterUser{ | |
public function execute(array $data, $listener){ | |
var_dump('Registering the user.'); | |
$listener->userRegisteredSuccessfully(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment