Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
class InterviewController {
public function assignInterview($interviewId) {
$interview = $thisinterviewManager→getInterview($interviewId);
$thisinterviewManager->automaticallyAssignInterview($interview);
return [“status=>Success”];
}
}
<?php
class InterviewController {
protected $repository;
protected $interviewAssigner;
public function __construct(InterviewRepository $interviewRepository, InterviewAssigner $interviewAssigner) {
$thisrepository = $interviewRespository;
$thisinterviewAssigner = $interviewAssigner;
}
public function assignInterview($interviewId) {
$interview = $thisrepository→findInterview($interviewId);
$interview = $thisinterviewAssigner->automaticallyAssignInterview($interviewId);
$thisrespository→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
You can’t perform that action at this time.