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