Created
February 21, 2017 15:47
-
-
Save icambridge/68a3a7ccd3739f566b108be76a4831e2 to your computer and use it in GitHub Desktop.
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
<?php | |
class InterviewController { | |
public function assignInterview($interviewId) { | |
$interview = $this→interviewManager→getInterview($interviewId); | |
$this→interviewManager->automaticallyAssignInterview($interview); | |
return [“status” => “Success”]; | |
} | |
} |
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
<?php | |
class InterviewController { | |
protected $repository; | |
protected $interviewAssigner; | |
public function __construct(InterviewRepository $interviewRepository, InterviewAssigner $interviewAssigner) { | |
$this→repository = $interviewRespository; | |
$this→interviewAssigner = $interviewAssigner; | |
} | |
public function assignInterview($interviewId) { | |
$interview = $this→repository→findInterview($interviewId); | |
$interview = $this→interviewAssigner->automaticallyAssignInterview($interviewId); | |
$this→respository→save($interview); | |
return [“status” => “Success”]; | |
} | |
} | |
class InterviewAssigner { | |
public function automaticallyAssignInterview($interviewId) {} | |
} | |
class InterviewRepository { | |
public function findInterview($interviewId) {} | |
public function save(Interview $interview) {} | |
} |
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
<?php | |
namespace App\Interview; | |
class InterviewManager { | |
public function createInterview(Interview $interview) {} | |
public function deleteInterview(Interview $interview) {} | |
public function scheduleInterview(Interview $interview) {} | |
public function findAllInterviews(Person $person) {} | |
public function isInterviewValid(Interview $interview) {} | |
public function automaticallyAssignInterview(Interview $interview) {} | |
public function postponeAllInterviewsForPerson(Person $person) {} | |
} |
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
<?php | |
namespace App\Interview; | |
class InterviewRepository { | |
public function createInterview(Interview $interview) {} | |
public function deleteInterview(Interview $interview) {} | |
public function findAllInterviews(Person $person) {} | |
public function findInterview($interviewId) {} | |
} | |
class InterviewScheduler { | |
public function scheduleInterview(Interview $interview) {} | |
public function automaticallyAssignInterview(Interview $interview) {} | |
public function postponeAllInterviewsForPerson(Person $person) {} | |
} | |
class InterviewValidator { | |
public function isValid(Interview $interview); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment