Skip to content

Instantly share code, notes, and snippets.

@icambridge
Created February 21, 2017 15:47
Show Gist options
  • Save icambridge/68a3a7ccd3739f566b108be76a4831e2 to your computer and use it in GitHub Desktop.
Save icambridge/68a3a7ccd3739f566b108be76a4831e2 to your computer and use it in GitHub Desktop.
<?php
class InterviewController {
public function assignInterview($interviewId) {
$interview = $this→interviewManager→getInterview($interviewId);
$this→interviewManager->automaticallyAssignInterview($interview);
return [“status” => “Success”];
}
}
<?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) {}
}
<?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) {}
}
<?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