File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 44
55use GuzzleHttp \Client ;
66use Psr \Log \LoggerInterface ;
7+ use Shopify \Service \AbstractService ;
78
89abstract class AbstractApi implements ApiInterface
910{
@@ -146,6 +147,17 @@ public function getApiVersion()
146147 return $ this ->api_version ;
147148 }
148149
150+ /**
151+ * Helper function to create new service instances
152+ *
153+ * @param $serviceClass Fully Qualified Service className
154+ * @return AbstractService
155+ */
156+ public function createService ($ serviceClass )
157+ {
158+ return new $ serviceClass ($ this );
159+ }
160+
149161 /**
150162 * Initialize our Client, using settings based on the app type
151163 *
Original file line number Diff line number Diff line change 22
33namespace Shopify ;
44
5- use Shopify \Service \AbstractService ;
65use Shopify \Storage \PersistentStorageInterface ;
76use Shopify \Storage \SessionStorage ;
87use Shopify \Helper \OAuthHelper ;
98use GuzzleHttp \Client ;
10- use Psr \Log \LoggerInterface ;
119
1210class Api extends AbstractApi
1311{
@@ -146,17 +144,6 @@ public function getOAuthHelper()
146144 return new OAuthHelper ($ this , $ this ->getStorageInterface ());
147145 }
148146
149- /**
150- * Helper function to create new service instances
151- *
152- * @param $serviceClass Fully Qualified Service className
153- * @return AbstractService
154- */
155- public function createService ($ serviceClass )
156- {
157- return new $ serviceClass ($ this );
158- }
159-
160147 public function loadApiKeyFromEnv ()
161148 {
162149 $ this ->api_key = getenv (self ::SHOPIFY_API_KEY_NAME );
You can’t perform that action at this time.
0 commit comments