objectManager = $objectManager; } /** * Change Vertex SDK's Factory to utilize ObjectManager * * @todo Convert to afterCreate once we only support Magento 2.2+ * * @param ServiceActionPerformerFactory $factory * @param callable $proceed * @param array $parameters * @return ServiceActionPerformer */ public function aroundCreate(ServiceActionPerformerFactory $factory, callable $proceed, array $parameters) { // Call the original to trigger its checks & exceptions $performer = $proceed($parameters); unset($performer); if (!isset($parameters['soapClientFactory'])) { // This is necessary to ensure that the plugins for the SoapClientFactory are utilized $parameters['soapClientFactory'] = $this->objectManager->get(SoapClientFactory::class); } return $this->objectManager->create(ServiceActionPerformer::class, $parameters); } }