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 4
4
5
5
use GuzzleHttp \Client ;
6
6
use Psr \Log \LoggerInterface ;
7
+ use Shopify \Service \AbstractService ;
7
8
8
9
abstract class AbstractApi implements ApiInterface
9
10
{
@@ -146,6 +147,17 @@ public function getApiVersion()
146
147
return $ this ->api_version ;
147
148
}
148
149
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
+
149
161
/**
150
162
* Initialize our Client, using settings based on the app type
151
163
*
Original file line number Diff line number Diff line change 2
2
3
3
namespace Shopify ;
4
4
5
- use Shopify \Service \AbstractService ;
6
5
use Shopify \Storage \PersistentStorageInterface ;
7
6
use Shopify \Storage \SessionStorage ;
8
7
use Shopify \Helper \OAuthHelper ;
9
8
use GuzzleHttp \Client ;
10
- use Psr \Log \LoggerInterface ;
11
9
12
10
class Api extends AbstractApi
13
11
{
@@ -146,17 +144,6 @@ public function getOAuthHelper()
146
144
return new OAuthHelper ($ this , $ this ->getStorageInterface ());
147
145
}
148
146
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
-
160
147
public function loadApiKeyFromEnv ()
161
148
{
162
149
$ this ->api_key = getenv (self ::SHOPIFY_API_KEY_NAME );
You can’t perform that action at this time.
0 commit comments