diff --git a/api/ApplicationContext.php b/api/ApplicationContext.php deleted file mode 100644 index 8dbb6079..00000000 --- a/api/ApplicationContext.php +++ /dev/null @@ -1,127 +0,0 @@ -get = array(); - - $this->get[PermissionChecker::class] = new PermissionChecker(); - $this->get[ModsForHeskSettingsGateway::class] = new ModsForHeskSettingsGateway(); - $this->get[CustomNavElementGateway::class] = new CustomNavElementGateway(); - $this->get[LoggingGateway::class] = new LoggingGateway(); - $this->get[VerifiedEmailGateway::class] = new VerifiedEmailGateway(); - $this->get[UserGateway::class] = new UserGateway(); - $this->get[CategoryGateway::class] = new CategoryGateway(); - $this->get[BanGateway::class] = new BanGateway(); - $this->get[StatusGateway::class] = new StatusGateway(); - $this->get[BasicEmailSender::class] = new BasicEmailSender(); - $this->get[MailgunEmailSender::class] = new MailgunEmailSender(); - $this->get[EmailTemplateRetriever::class] = new EmailTemplateRetriever(); - $this->get[TicketGateway::class] = new TicketGateway(); - $this->get[FileWriter::class] = new FileWriter(); - $this->get[FileReader::class] = new FileReader(); - $this->get[FileDeleter::class] = new FileDeleter(); - $this->get[AttachmentGateway::class] = new AttachmentGateway(); - - $this->get[ApiChecker::class] = new ApiChecker($this->get[ModsForHeskSettingsGateway::class]); - $this->get[CustomNavElementHandler::class] = new CustomNavElementHandler($this->get[CustomNavElementGateway::class]); - $this->get[VerifiedEmailChecker::class] = new VerifiedEmailChecker($this->get[VerifiedEmailGateway::class]); - $this->get[UserContextBuilder::class] = new UserContextBuilder($this->get[UserGateway::class]); - $this->get[BanRetriever::class] = new BanRetriever($this->get[BanGateway::class]); - $this->get[UserToTicketChecker::class] = new UserToTicketChecker($this->get[UserGateway::class]); - $this->get[StatusRetriever::class] = new StatusRetriever($this->get[StatusGateway::class]); - $this->get[SettingsRetriever::class] = new SettingsRetriever($this->get[ModsForHeskSettingsGateway::class]); - $this->get[TicketValidators::class] = new TicketValidators($this->get[TicketGateway::class]); - $this->get[TrackingIdGenerator::class] = new TrackingIdGenerator($this->get[TicketGateway::class]); - $this->get[Autoassigner::class] = new Autoassigner($this->get[CategoryGateway::class], $this->get[UserGateway::class]); - $this->get[CategoryRetriever::class] = new CategoryRetriever($this->get[CategoryGateway::class], - $this->get[ModsForHeskSettingsGateway::class]); - $this->get[CategoryHandler::class] = new CategoryHandler( - $this->get[CategoryGateway::class], - $this->get[TicketGateway::class], - $this->get[PermissionChecker::class], - $this->get[ModsForHeskSettingsGateway::class]); - $this->get[EmailTemplateParser::class] = new EmailTemplateParser($this->get[StatusGateway::class], - $this->get[CategoryGateway::class], - $this->get[UserGateway::class], - $this->get[EmailTemplateRetriever::class]); - $this->get[EmailSenderHelper::class] = new EmailSenderHelper($this->get[EmailTemplateParser::class], - $this->get[BasicEmailSender::class], - $this->get[MailgunEmailSender::class]); - $this->get[TicketRetriever::class] = new TicketRetriever($this->get[TicketGateway::class], - $this->get[UserToTicketChecker::class]); - $this->get[NewTicketValidator::class] = new NewTicketValidator($this->get[CategoryRetriever::class], - $this->get[BanRetriever::class], - $this->get[TicketValidators::class]); - $this->get[TicketCreator::class] = new TicketCreator($this->get[NewTicketValidator::class], - $this->get[TrackingIdGenerator::class], - $this->get[Autoassigner::class], - $this->get[StatusGateway::class], - $this->get[TicketGateway::class], - $this->get[VerifiedEmailChecker::class], - $this->get[EmailSenderHelper::class], - $this->get[UserGateway::class], - $this->get[ModsForHeskSettingsGateway::class]); - $this->get[AttachmentHandler::class] = new AttachmentHandler($this->get[TicketGateway::class], - $this->get[AttachmentGateway::class], - $this->get[FileWriter::class], - $this->get[UserToTicketChecker::class], - $this->get[FileDeleter::class]); - $this->get[AttachmentRetriever::class] = new AttachmentRetriever($this->get[AttachmentGateway::class], - $this->get[FileReader::class], - $this->get[TicketGateway::class], - $this->get[UserToTicketChecker::class]); - $this->get[TicketDeleter::class] = - new TicketDeleter($this->get[TicketGateway::class], - $this->get[UserToTicketChecker::class], - $this->get[AttachmentHandler::class]); - $this->get[TicketEditor::class] = - new TicketEditor($this->get[TicketGateway::class], $this->get[UserToTicketChecker::class]); - } -} \ No newline at end of file diff --git a/api/Controllers/Attachments/PublicAttachmentController.php b/api/Controllers/Attachments/PublicAttachmentController.php index c5e9077c..c12325a5 100644 --- a/api/Controllers/Attachments/PublicAttachmentController.php +++ b/api/Controllers/Attachments/PublicAttachmentController.php @@ -14,7 +14,7 @@ class PublicAttachmentController { self::verifyAttachmentsAreEnabled($hesk_settings); /* @var $attachmentRetriever AttachmentRetriever */ - $attachmentRetriever = $applicationContext->get[AttachmentRetriever::class]; + $attachmentRetriever = $applicationContext->get(AttachmentRetriever::class); $attachment = $attachmentRetriever->getAttachmentContentsForTrackingId($trackingId, $attachmentId, $userContext, $hesk_settings); diff --git a/api/Controllers/Attachments/StaffTicketAttachmentsController.php b/api/Controllers/Attachments/StaffTicketAttachmentsController.php index 1d32f812..7f6a09c0 100644 --- a/api/Controllers/Attachments/StaffTicketAttachmentsController.php +++ b/api/Controllers/Attachments/StaffTicketAttachmentsController.php @@ -18,7 +18,7 @@ class StaffTicketAttachmentsController { $this->verifyAttachmentsAreEnabled($hesk_settings); /* @var $attachmentRetriever AttachmentRetriever */ - $attachmentRetriever = $applicationContext->get[AttachmentRetriever::class]; + $attachmentRetriever = $applicationContext->get(AttachmentRetriever::class); $contents = $attachmentRetriever->getAttachmentContentsForTicket($ticketId, $attachmentId, $userContext, $hesk_settings); @@ -37,7 +37,7 @@ class StaffTicketAttachmentsController { $this->verifyAttachmentsAreEnabled($hesk_settings); /* @var $attachmentHandler AttachmentHandler */ - $attachmentHandler = $applicationContext->get[AttachmentHandler::class]; + $attachmentHandler = $applicationContext->get(AttachmentHandler::class); $createAttachmentForTicketModel = $this->createModel(JsonRetriever::getJsonData(), $ticketId); @@ -61,7 +61,7 @@ class StaffTicketAttachmentsController { global $applicationContext, $hesk_settings, $userContext; /* @var $attachmentHandler AttachmentHandler */ - $attachmentHandler = $applicationContext->get[AttachmentHandler::class]; + $attachmentHandler = $applicationContext->get(AttachmentHandler::class); $attachmentHandler->deleteAttachmentFromTicket($ticketId, $attachmentId, $userContext, $hesk_settings); diff --git a/api/Controllers/Categories/CategoryController.php b/api/Controllers/Categories/CategoryController.php index 8daa326f..e72f680b 100644 --- a/api/Controllers/Categories/CategoryController.php +++ b/api/Controllers/Categories/CategoryController.php @@ -30,7 +30,7 @@ class CategoryController { global $hesk_settings, $applicationContext, $userContext; /* @var $categoryRetriever CategoryRetriever */ - $categoryRetriever = $applicationContext->get[CategoryRetriever::class]; + $categoryRetriever = $applicationContext->get(CategoryRetriever::class); return $categoryRetriever->getAllCategories($hesk_settings, $userContext); } @@ -43,7 +43,7 @@ class CategoryController { $category = $this->buildCategoryFromJson($data); /* @var $categoryHandler CategoryHandler */ - $categoryHandler = $applicationContext->get[CategoryHandler::class]; + $categoryHandler = $applicationContext->get(CategoryHandler::class); $category = $categoryHandler->createCategory($category, $userContext, $hesk_settings); @@ -81,7 +81,7 @@ class CategoryController { $category->id = intval($id); /* @var $categoryHandler CategoryHandler */ - $categoryHandler = $applicationContext->get[CategoryHandler::class]; + $categoryHandler = $applicationContext->get(CategoryHandler::class); $category = $categoryHandler->editCategory($category, $userContext, $hesk_settings); @@ -92,7 +92,7 @@ class CategoryController { global $hesk_settings, $userContext, $applicationContext; /* @var $categoryHandler CategoryHandler */ - $categoryHandler = $applicationContext->get[CategoryHandler::class]; + $categoryHandler = $applicationContext->get(CategoryHandler::class); $categoryHandler->deleteCategory($id, $userContext, $hesk_settings); @@ -103,7 +103,7 @@ class CategoryController { global $applicationContext, $hesk_settings; /* @var $handler CategoryHandler */ - $handler = $applicationContext->get[CategoryHandler::class]; + $handler = $applicationContext->get(CategoryHandler::class); $handler->sortCategory(intval($id), $direction, $hesk_settings); } diff --git a/api/Controllers/Navigation/CustomNavElementController.php b/api/Controllers/Navigation/CustomNavElementController.php index d4a514e7..8196eb16 100644 --- a/api/Controllers/Navigation/CustomNavElementController.php +++ b/api/Controllers/Navigation/CustomNavElementController.php @@ -3,7 +3,6 @@ namespace Controllers\Navigation; -use BusinessLogic\Exceptions\ApiFriendlyException; use BusinessLogic\Helpers; use BusinessLogic\Navigation\CustomNavElement; use BusinessLogic\Navigation\CustomNavElementHandler; @@ -17,7 +16,7 @@ class CustomNavElementController extends InternalApiController { self::staticCheckForInternalUseOnly(); /* @var $handler CustomNavElementHandler */ - $handler = $applicationContext->get[CustomNavElementHandler::class]; + $handler = $applicationContext->get(CustomNavElementHandler::class); output($handler->getAllCustomNavElements($hesk_settings)); } @@ -28,7 +27,7 @@ class CustomNavElementController extends InternalApiController { self::staticCheckForInternalUseOnly(); /* @var $handler CustomNavElementHandler */ - $handler = $applicationContext->get[CustomNavElementHandler::class]; + $handler = $applicationContext->get(CustomNavElementHandler::class); $handler->sortCustomNavElement(intval($id), $direction, $hesk_settings); } @@ -39,7 +38,7 @@ class CustomNavElementController extends InternalApiController { $this->checkForInternalUseOnly(); /* @var $handler CustomNavElementHandler */ - $handler = $applicationContext->get[CustomNavElementHandler::class]; + $handler = $applicationContext->get(CustomNavElementHandler::class); output($handler->getCustomNavElement($id, $hesk_settings)); } @@ -50,7 +49,7 @@ class CustomNavElementController extends InternalApiController { $this->checkForInternalUseOnly(); /* @var $handler CustomNavElementHandler */ - $handler = $applicationContext->get[CustomNavElementHandler::class]; + $handler = $applicationContext->get(CustomNavElementHandler::class); $data = JsonRetriever::getJsonData(); $element = $handler->createCustomNavElement($this->buildElementModel($data), $hesk_settings); @@ -64,7 +63,7 @@ class CustomNavElementController extends InternalApiController { $this->checkForInternalUseOnly(); /* @var $handler CustomNavElementHandler */ - $handler = $applicationContext->get[CustomNavElementHandler::class]; + $handler = $applicationContext->get(CustomNavElementHandler::class); $data = JsonRetriever::getJsonData(); $handler->saveCustomNavElement($this->buildElementModel($data, $id), $hesk_settings); @@ -78,7 +77,7 @@ class CustomNavElementController extends InternalApiController { $this->checkForInternalUseOnly(); /* @var $handler CustomNavElementHandler */ - $handler = $applicationContext->get[CustomNavElementHandler::class]; + $handler = $applicationContext->get(CustomNavElementHandler::class); $handler->deleteCustomNavElement($id, $hesk_settings); diff --git a/api/Controllers/Settings/SettingsController.php b/api/Controllers/Settings/SettingsController.php index c8e53941..4e66016a 100644 --- a/api/Controllers/Settings/SettingsController.php +++ b/api/Controllers/Settings/SettingsController.php @@ -7,11 +7,11 @@ use BusinessLogic\Settings\SettingsRetriever; class SettingsController { function get() { - global $applicationContext, $hesk_settings, $modsForHesk_settings; + global $applicationContext, $hesk_settings; /* @var $settingsRetriever SettingsRetriever */ - $settingsRetriever = $applicationContext->get[SettingsRetriever::class]; + $settingsRetriever = $applicationContext->get(SettingsRetriever::class); - output($settingsRetriever->getAllSettings($hesk_settings, $modsForHesk_settings)); + output($settingsRetriever->getAllSettings($hesk_settings)); } } \ No newline at end of file diff --git a/api/Controllers/Statuses/StatusController.php b/api/Controllers/Statuses/StatusController.php index f9e2f087..536c6b60 100644 --- a/api/Controllers/Statuses/StatusController.php +++ b/api/Controllers/Statuses/StatusController.php @@ -10,7 +10,7 @@ class StatusController { global $applicationContext, $hesk_settings; /* @var $statusRetriever StatusRetriever */ - $statusRetriever = $applicationContext->get[StatusRetriever::class]; + $statusRetriever = $applicationContext->get(StatusRetriever::class); output($statusRetriever->getAllStatuses($hesk_settings)); } diff --git a/api/Controllers/Tickets/CustomerTicketController.php b/api/Controllers/Tickets/CustomerTicketController.php index cd8e9481..2b1b2614 100644 --- a/api/Controllers/Tickets/CustomerTicketController.php +++ b/api/Controllers/Tickets/CustomerTicketController.php @@ -18,7 +18,7 @@ class CustomerTicketController { $emailAddress = isset($_GET['email']) ? $_GET['email'] : null; /* @var $ticketRetriever TicketRetriever */ - $ticketRetriever = $applicationContext->get[TicketRetriever::class]; + $ticketRetriever = $applicationContext->get(TicketRetriever::class); output($ticketRetriever->getTicketByTrackingIdAndEmail($trackingId, $emailAddress, $hesk_settings)); } @@ -27,7 +27,7 @@ class CustomerTicketController { global $applicationContext, $hesk_settings, $userContext; /* @var $ticketCreator TicketCreator */ - $ticketCreator = $applicationContext->get[TicketCreator::class]; + $ticketCreator = $applicationContext->get(TicketCreator::class); $jsonRequest = JsonRetriever::getJsonData(); diff --git a/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php b/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php index 79fb5a62..fe2aa7be 100644 --- a/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php +++ b/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php @@ -19,15 +19,15 @@ class ResendTicketEmailToCustomerController extends InternalApiController { $this->checkForInternalUseOnly(); /* @var $ticketRetriever TicketRetriever */ - $ticketRetriever = $applicationContext->get[TicketRetriever::class]; + $ticketRetriever = $applicationContext->get(TicketRetriever::class); $ticket = $ticketRetriever->getTicketById($ticketId, $hesk_settings, $userContext); /* @var $modsForHeskSettingsGateway ModsForHeskSettingsGateway */ - $modsForHeskSettingsGateway = $applicationContext->get[ModsForHeskSettingsGateway::class]; + $modsForHeskSettingsGateway = $applicationContext->get(ModsForHeskSettingsGateway::class); $modsForHeskSettings = $modsForHeskSettingsGateway->getAllSettings($hesk_settings); /* @var $emailSender EmailSenderHelper */ - $emailSender = $applicationContext->get[EmailSenderHelper::class]; + $emailSender = $applicationContext->get(EmailSenderHelper::class); $language = $ticket->language; diff --git a/api/Controllers/Tickets/StaffTicketController.php b/api/Controllers/Tickets/StaffTicketController.php index 001cd556..a4860f07 100644 --- a/api/Controllers/Tickets/StaffTicketController.php +++ b/api/Controllers/Tickets/StaffTicketController.php @@ -15,7 +15,7 @@ class StaffTicketController { global $applicationContext, $userContext, $hesk_settings; /* @var $ticketRetriever TicketRetriever */ - $ticketRetriever = $applicationContext->get[TicketRetriever::class]; + $ticketRetriever = $applicationContext->get(TicketRetriever::class); output($ticketRetriever->getTicketById($id, $hesk_settings, $userContext)); } @@ -24,7 +24,7 @@ class StaffTicketController { global $applicationContext, $userContext, $hesk_settings; /* @var $ticketDeleter TicketDeleter */ - $ticketDeleter = $applicationContext->get[TicketDeleter::class]; + $ticketDeleter = $applicationContext->get(TicketDeleter::class); $ticketDeleter->deleteTicket($id, $userContext, $hesk_settings); @@ -35,7 +35,7 @@ class StaffTicketController { global $applicationContext, $userContext, $hesk_settings; /* @var $ticketEditor TicketEditor */ - $ticketEditor = $applicationContext->get[TicketEditor::class]; + $ticketEditor = $applicationContext->get(TicketEditor::class); $jsonRequest = JsonRetriever::getJsonData(); diff --git a/api/autoload.php b/api/autoload.php index b9c2292e..0712c2e1 100644 --- a/api/autoload.php +++ b/api/autoload.php @@ -21,4 +21,7 @@ global $hesk_settings; require_once(__DIR__ . '/../inc/custom_fields.inc.php'); // Load the ApplicationContext -$applicationContext = new \ApplicationContext(); \ No newline at end of file +$builder = new \DI\ContainerBuilder(); +$builder->setDefinitionCache(new \Doctrine\Common\Cache\ArrayCache()); + +$applicationContext = $builder->build(); \ No newline at end of file diff --git a/api/composer.json b/api/composer.json index ba08aee6..d5194dea 100644 --- a/api/composer.json +++ b/api/composer.json @@ -12,6 +12,12 @@ "require-dev": { "phpunit/phpunit": "6.3.0" }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/mike-koch/PHP-DI" + } + ], "require": { "phpmailer/phpmailer": "^5.2", "mailgun/mailgun-php": "^2.1", @@ -19,6 +25,6 @@ "php-http/message": "^1.5", "php-http/curl-client": "^1.7", "guzzlehttp/psr7": "^1.3", - "php-di/php-di": "4.4.10" + "php-di/php-di": "dev-master" } } diff --git a/api/composer.lock b/api/composer.lock index ec939825..c9d00a68 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "d7d3d7ef4a481f28ec59f1218cbc9a1a", + "content-hash": "c94a62f4b72739c52334647f4b759251", "packages": [ { "name": "clue/stream-filter", @@ -624,16 +624,16 @@ }, { "name": "php-di/php-di", - "version": "4.4.10", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/PHP-DI/PHP-DI.git", - "reference": "cc10862b66267b6e6f793eda2867b0aef5b693be" + "url": "https://github.com/mike-koch/PHP-DI.git", + "reference": "02ae2f2f79f3c09f711f8936e2c69cc65a530f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/cc10862b66267b6e6f793eda2867b0aef5b693be", - "reference": "cc10862b66267b6e6f793eda2867b0aef5b693be", + "url": "https://api.github.com/repos/mike-koch/PHP-DI/zipball/02ae2f2f79f3c09f711f8936e2c69cc65a530f1b", + "reference": "02ae2f2f79f3c09f711f8936e2c69cc65a530f1b", "shasum": "" }, "require": { @@ -657,7 +657,12 @@ "src/DI/functions.php" ] }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "DI\\Test\\IntegrationTest\\": "tests/IntegrationTest/", + "DI\\Test\\UnitTest\\": "tests/UnitTest/" + } + }, "license": [ "MIT" ], @@ -668,7 +673,10 @@ "dependency injection", "di" ], - "time": "2015-07-24T09:21:24+00:00" + "support": { + "source": "https://github.com/mike-koch/PHP-DI/tree/master" + }, + "time": "2017-09-08 02:07:52" }, { "name": "php-di/phpdoc-reader", @@ -1767,7 +1775,7 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-04-07T07:07:10+00:00" + "time": "2017-04-07 07:07:10" }, { "name": "phar-io/version", @@ -2087,7 +2095,7 @@ "testing", "xunit" ], - "time": "2017-08-25T06:32:04+00:00" + "time": "2017-08-25 06:32:04" }, { "name": "phpunit/php-file-iterator", @@ -2416,7 +2424,7 @@ "mock", "xunit" ], - "time": "2017-08-03T14:08:16+00:00" + "time": "2017-08-03 14:08:16" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2525,7 +2533,7 @@ "compare", "equality" ], - "time": "2017-08-20T14:03:32+00:00" + "time": "2017-08-20 14:03:32" }, { "name": "sebastian/diff", @@ -2627,7 +2635,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2017-07-01 08:51:00" }, { "name": "sebastian/exporter", @@ -2694,7 +2702,7 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2017-04-03 13:19:02" }, { "name": "sebastian/global-state", @@ -2792,7 +2800,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" + "time": "2017-08-03 12:35:26" }, { "name": "sebastian/object-reflector", @@ -2837,7 +2845,7 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "time": "2017-03-29 09:07:27" }, { "name": "sebastian/recursion-context", @@ -3020,7 +3028,9 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "php-di/php-di": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": [], diff --git a/api/index.php b/api/index.php index 05dba913..b4c3b490 100644 --- a/api/index.php +++ b/api/index.php @@ -50,7 +50,7 @@ function assertApiIsEnabled() { global $applicationContext, $hesk_settings; /* @var $apiChecker \BusinessLogic\Settings\ApiChecker */ - $apiChecker = $applicationContext->get[\BusinessLogic\Settings\ApiChecker::class]; + $apiChecker = $applicationContext->get(\BusinessLogic\Settings\ApiChecker::class); if (!$apiChecker->isApiEnabled($hesk_settings)) { print output(array('message' => 'API Disabled'), 404); @@ -77,7 +77,7 @@ function buildUserContext($xAuthToken) { global $applicationContext, $userContext, $hesk_settings; /* @var $userContextBuilder \BusinessLogic\Security\UserContextBuilder */ - $userContextBuilder = $applicationContext->get[\BusinessLogic\Security\UserContextBuilder::class]; + $userContextBuilder = $applicationContext->get(\BusinessLogic\Security\UserContextBuilder::class); $userContext = $userContextBuilder->buildUserContext($xAuthToken, $hesk_settings); } @@ -90,17 +90,13 @@ function errorHandler($errorNumber, $errorMessage, $errorFile, $errorLine) { * @param $exception Exception */ function exceptionHandler($exception) { - global $applicationContext, $userContext, $hesk_settings; + global $userContext, $hesk_settings; if (strpos($exception->getTraceAsString(), 'LoggingGateway') !== false) { //-- Suppress these for now, as it would cause issues to output two JSONs at one time. return; } - - /* @var $loggingGateway \DataAccess\Logging\LoggingGateway */ - $loggingGateway = $applicationContext->get[\DataAccess\Logging\LoggingGateway::class]; - // We don't cast API Friendly Exceptions as they're user-generated errors if (exceptionIsOfType($exception, \BusinessLogic\Exceptions\ApiFriendlyException::class)) { /* @var $castedException \BusinessLogic\Exceptions\ApiFriendlyException */ @@ -142,7 +138,7 @@ function tryToLog($location, $message, $stackTrace, $userContext, $heskSettings) global $applicationContext; /* @var $loggingGateway \DataAccess\Logging\LoggingGateway */ - $loggingGateway = $applicationContext->get[\DataAccess\Logging\LoggingGateway::class]; + $loggingGateway = $applicationContext->get(\DataAccess\Logging\LoggingGateway::class); try { return $loggingGateway->logError($location, $message, $stackTrace, $userContext, $heskSettings);