Skip to content

Commit

Permalink
fix: Remove new container usage in migration (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaraslau-kavaliou authored Nov 9, 2023
1 parent 5e54fca commit 6117061
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions migrations/Version202309041508164049_taoOutcomeUi.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ public function getDescription(): string

public function up(Schema $schema): void
{
if (!$this->getServiceManager()->getContainer()->has(ResultsViewerService::SERVICE_ID)) {
if (!$this->getServiceManager()->has(ResultsViewerService::SERVICE_ID)) {
return;
}

/** @var ResultsViewerService $service */
$service = $this->getServiceManager()->getContainer()->get(ResultsViewerService::SERVICE_ID);
$service = $this->getServiceManager()->get(ResultsViewerService::SERVICE_ID);
$defaultItemType = $service->getDefaultItemType();

if (!$defaultItemType) {
return;
}

/** @var DeliveryItemTypeService $service */
$service = $this->getServiceManager()->getContainer()->get(DeliveryItemTypeService::SERVICE_ID);
$service = $this->getServiceManager()->get(DeliveryItemTypeService::SERVICE_ID);
$service->setDefaultItemType($defaultItemType);
$this->getServiceManager()->register(DeliveryItemTypeService::SERVICE_ID, $service);
}
Expand Down

0 comments on commit 6117061

Please sign in to comment.