<?php/** * Created by PhpStorm. * User: Zero * Date: 2020/8/19 * Time: 9:25 */namespaceMeibuyu\Micro\Shopify;useHyperf\Contract\ContainerInterface;classShopifyFactory{/** * @var ContainerInterface */private$container;publicfunction__construct(ContainerInterface$container){$this->container=$container;}publicfunctioncreate(array$config=[]):ShopifyApp{if(method_exists($this->container,'make')){// Create by DI for AOP.return$this->container->make(ShopifyApp::class,['config'=>$config]);}returnnewShopifyApp($config);}}