Add strongly typed constructor args on BusinessLogic layer
This commit is contained in:
parent
f700addda5
commit
7ca00fecbe
@ -33,7 +33,11 @@ class AttachmentHandler {
|
||||
/* @var $userToTicketChecker UserToTicketChecker */
|
||||
private $userToTicketChecker;
|
||||
|
||||
function __construct($ticketGateway, $attachmentGateway, $fileWriter, $userToTicketChecker, $fileDeleter) {
|
||||
function __construct(TicketGateway $ticketGateway,
|
||||
AttachmentGateway $attachmentGateway,
|
||||
FileWriter $fileWriter,
|
||||
UserToTicketChecker $userToTicketChecker,
|
||||
FileDeleter $fileDeleter) {
|
||||
$this->ticketGateway = $ticketGateway;
|
||||
$this->attachmentGateway = $attachmentGateway;
|
||||
$this->fileWriter = $fileWriter;
|
||||
|
@ -26,7 +26,10 @@ class CategoryHandler {
|
||||
/* @var $modsForHeskSettingsGateway ModsForHeskSettingsGateway */
|
||||
private $modsForHeskSettingsGateway;
|
||||
|
||||
function __construct($categoryGateway, $ticketGateway, $permissionChecker, $modsForHeskSettingsGateway) {
|
||||
function __construct(CategoryGateway $categoryGateway,
|
||||
TicketGateway $ticketGateway,
|
||||
PermissionChecker $permissionChecker,
|
||||
ModsForHeskSettingsGateway $modsForHeskSettingsGateway) {
|
||||
$this->categoryGateway = $categoryGateway;
|
||||
$this->ticketGateway = $ticketGateway;
|
||||
$this->permissionChecker = $permissionChecker;
|
||||
|
@ -17,7 +17,8 @@ class CategoryRetriever {
|
||||
*/
|
||||
private $modsForHeskSettingsGateway;
|
||||
|
||||
function __construct($categoryGateway, $modsForHeskSettingsGateway) {
|
||||
function __construct(CategoryGateway $categoryGateway,
|
||||
ModsForHeskSettingsGateway $modsForHeskSettingsGateway) {
|
||||
$this->categoryGateway = $categoryGateway;
|
||||
$this->modsForHeskSettingsGateway = $modsForHeskSettingsGateway;
|
||||
}
|
||||
|
@ -21,7 +21,9 @@ class EmailSenderHelper {
|
||||
*/
|
||||
private $mailgunEmailSender;
|
||||
|
||||
function __construct($emailTemplateParser, $basicEmailSender, $mailgunEmailSender) {
|
||||
function __construct(EmailTemplateParser $emailTemplateParser,
|
||||
BasicEmailSender $basicEmailSender,
|
||||
MailgunEmailSender $mailgunEmailSender) {
|
||||
$this->emailTemplateParser = $emailTemplateParser;
|
||||
$this->basicEmailSender = $basicEmailSender;
|
||||
$this->mailgunEmailSender = $mailgunEmailSender;
|
||||
|
@ -35,7 +35,10 @@ class EmailTemplateParser {
|
||||
*/
|
||||
private $emailTemplateRetriever;
|
||||
|
||||
function __construct($statusGateway, $categoryGateway, $userGateway, $emailTemplateRetriever) {
|
||||
function __construct(StatusGateway $statusGateway,
|
||||
CategoryGateway $categoryGateway,
|
||||
UserGateway $userGateway,
|
||||
EmailTemplateRetriever $emailTemplateRetriever) {
|
||||
$this->statusGateway = $statusGateway;
|
||||
$this->categoryGateway = $categoryGateway;
|
||||
$this->userGateway = $userGateway;
|
||||
@ -50,6 +53,7 @@ class EmailTemplateParser {
|
||||
* @param $modsForHeskSettings array
|
||||
* @return ParsedEmailProperties
|
||||
* @throws InvalidEmailTemplateException
|
||||
* @throws \Exception
|
||||
*/
|
||||
function getFormattedEmailForLanguage($templateId, $languageCode, $ticket, $heskSettings, $modsForHeskSettings) {
|
||||
global $hesklang;
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 2/28/2017
|
||||
* Time: 9:36 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Emails;
|
||||
|
||||
|
@ -10,7 +10,7 @@ class CustomNavElementHandler {
|
||||
/* @var $customNavElementGateway CustomNavElementGateway */
|
||||
private $customNavElementGateway;
|
||||
|
||||
function __construct($customNavElementGateway) {
|
||||
function __construct(CustomNavElementGateway $customNavElementGateway) {
|
||||
$this->customNavElementGateway = $customNavElementGateway;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ class BanRetriever {
|
||||
*/
|
||||
private $banGateway;
|
||||
|
||||
function __construct($banGateway) {
|
||||
function __construct(BanGateway $banGateway) {
|
||||
$this->banGateway = $banGateway;
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ class UserContextBuilder {
|
||||
*/
|
||||
private $userGateway;
|
||||
|
||||
function __construct($userGateway) {
|
||||
function __construct(UserGateway $userGateway) {
|
||||
$this->userGateway = $userGateway;
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ class UserToTicketChecker {
|
||||
/* @var $userGateway UserGateway */
|
||||
private $userGateway;
|
||||
|
||||
function __construct($userGateway) {
|
||||
function __construct(UserGateway $userGateway) {
|
||||
$this->userGateway = $userGateway;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ class ApiChecker {
|
||||
/* @var $modsForHeskSettingsGateway ModsForHeskSettingsGateway */
|
||||
private $modsForHeskSettingsGateway;
|
||||
|
||||
function __construct($modsForHeskSettingsGateway) {
|
||||
function __construct(ModsForHeskSettingsGateway $modsForHeskSettingsGateway) {
|
||||
$this->modsForHeskSettingsGateway = $modsForHeskSettingsGateway;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ class SettingsRetriever {
|
||||
/* @var $modsForHeskSettingsGateway ModsForHeskSettingsGateway */
|
||||
private $modsForHeskSettingsGateway;
|
||||
|
||||
function __construct($modsForHeskSettingsGateway) {
|
||||
function __construct(ModsForHeskSettingsGateway $modsForHeskSettingsGateway) {
|
||||
$this->modsForHeskSettingsGateway = $modsForHeskSettingsGateway;
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ class StatusRetriever {
|
||||
/* @var $statusGateway StatusGateway */
|
||||
private $statusGateway;
|
||||
|
||||
function __construct($statusGateway) {
|
||||
function __construct(StatusGateway $statusGateway) {
|
||||
$this->statusGateway = $statusGateway;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,8 @@ class Autoassigner {
|
||||
/* @var $userGateway UserGateway */
|
||||
private $userGateway;
|
||||
|
||||
function __construct($categoryGateway, $userGateway) {
|
||||
function __construct(CategoryGateway $categoryGateway,
|
||||
UserGateway $userGateway) {
|
||||
$this->categoryGateway = $categoryGateway;
|
||||
$this->userGateway = $userGateway;
|
||||
}
|
||||
|
@ -24,7 +24,9 @@ class NewTicketValidator {
|
||||
*/
|
||||
private $ticketValidators;
|
||||
|
||||
function __construct($categoryRetriever, $banRetriever, $ticketValidators) {
|
||||
function __construct(CategoryRetriever $categoryRetriever,
|
||||
BanRetriever $banRetriever,
|
||||
TicketValidators $ticketValidators) {
|
||||
$this->categoryRetriever = $categoryRetriever;
|
||||
$this->banRetriever = $banRetriever;
|
||||
$this->ticketValidators = $ticketValidators;
|
||||
|
@ -56,8 +56,15 @@ class TicketCreator {
|
||||
/* @var $modsForHeskSettingsGateway ModsForHeskSettingsGateway */
|
||||
private $modsForHeskSettingsGateway;
|
||||
|
||||
function __construct($newTicketValidator, $trackingIdGenerator, $autoassigner, $statusGateway, $ticketGateway,
|
||||
$verifiedEmailChecker, $emailSenderHelper, $userGateway, $modsForHeskSettingsGateway) {
|
||||
function __construct(NewTicketValidator $newTicketValidator,
|
||||
TrackingIdGenerator $trackingIdGenerator,
|
||||
Autoassigner $autoassigner,
|
||||
StatusGateway $statusGateway,
|
||||
TicketGateway $ticketGateway,
|
||||
VerifiedEmailChecker $verifiedEmailChecker,
|
||||
EmailSenderHelper $emailSenderHelper,
|
||||
UserGateway $userGateway,
|
||||
ModsForHeskSettingsGateway $modsForHeskSettingsGateway) {
|
||||
$this->newTicketValidator = $newTicketValidator;
|
||||
$this->trackingIdGenerator = $trackingIdGenerator;
|
||||
$this->autoassigner = $autoassigner;
|
||||
|
@ -20,7 +20,9 @@ class TicketDeleter {
|
||||
/* @var $attachmentHandler AttachmentHandler */
|
||||
private $attachmentHandler;
|
||||
|
||||
function __construct($ticketGateway, $userToTicketChecker, $attachmentHandler) {
|
||||
function __construct(TicketGateway $ticketGateway,
|
||||
UserToTicketChecker $userToTicketChecker,
|
||||
AttachmentHandler $attachmentHandler) {
|
||||
$this->ticketGateway = $ticketGateway;
|
||||
$this->userToTicketChecker = $userToTicketChecker;
|
||||
$this->attachmentHandler = $attachmentHandler;
|
||||
|
@ -22,7 +22,8 @@ class TicketEditor {
|
||||
/* @var $userToTicketChecker UserToTicketChecker */
|
||||
private $userToTicketChecker;
|
||||
|
||||
function __construct($ticketGateway, $userToTicketChecker) {
|
||||
function __construct(TicketGateway $ticketGateway,
|
||||
UserToTicketChecker $userToTicketChecker) {
|
||||
$this->ticketGateway = $ticketGateway;
|
||||
$this->userToTicketChecker = $userToTicketChecker;
|
||||
}
|
||||
|
@ -19,7 +19,8 @@ class TicketRetriever {
|
||||
/* @var $userToTicketChecker UserToTicketChecker */
|
||||
private $userToTicketChecker;
|
||||
|
||||
function __construct($ticketGateway, $userToTicketChecker) {
|
||||
function __construct(TicketGateway $ticketGateway,
|
||||
UserToTicketChecker $userToTicketChecker) {
|
||||
$this->ticketGateway = $ticketGateway;
|
||||
$this->userToTicketChecker = $userToTicketChecker;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ class TicketValidators {
|
||||
*/
|
||||
private $ticketGateway;
|
||||
|
||||
function __construct($ticketGateway) {
|
||||
function __construct(TicketGateway $ticketGateway) {
|
||||
$this->ticketGateway = $ticketGateway;
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ class TrackingIdGenerator {
|
||||
*/
|
||||
private $ticketGateway;
|
||||
|
||||
function __construct($ticketGateway) {
|
||||
function __construct(TicketGateway $ticketGateway) {
|
||||
$this->ticketGateway = $ticketGateway;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class VerifiedEmailChecker {
|
||||
*/
|
||||
private $verifiedEmailGateway;
|
||||
|
||||
function __construct($verifiedEmailGateway) {
|
||||
function __construct(VerifiedEmailGateway $verifiedEmailGateway) {
|
||||
$this->verifiedEmailGateway = $verifiedEmailGateway;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user