@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $first_run = ((Configure::check('Multidimensional/Shopify')) ? false : true); |
36 | 36 | |
37 | 37 | //Activate Plugin |
38 | - if ((($first_run) ? (strtolower($this->in('Install Shopify Plugin?', ['y','n'])) == 'y') : (strtolower($this->in('Update Configuration?', ['y','n'])) == 'y'))) { |
|
38 | + if ((($first_run) ? (strtolower($this->in('Install Shopify Plugin?', ['y', 'n'])) == 'y') : (strtolower($this->in('Update Configuration?', ['y', 'n'])) == 'y'))) { |
|
39 | 39 | |
40 | 40 | |
41 | 41 | $this->out(); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | $scope = array_map('trim', $scope); |
68 | 68 | $scope = array_map('strtolower', $scope); |
69 | - array_walk($scope, function (&$value) { |
|
69 | + array_walk($scope, function(&$value) { |
|
70 | 70 | $value = str_replace(" ", "_", $value); |
71 | 71 | }); |
72 | 72 | |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | $this->_io->out('<error>Invalid Scope. Try again, or leave blank to continue.</error>'); |
76 | 76 | } |
77 | 77 | |
78 | - } while((count($scope)) && (strlen(trim(implode("", $scope))) > 0) && (count(array_diff($scope, $scope_array)) > 0)); |
|
78 | + } while ((count($scope)) && (strlen(trim(implode("", $scope))) > 0) && (count(array_diff($scope, $scope_array)) > 0)); |
|
79 | 79 | |
80 | - Configure::write('Multidimensional/Shopify.' . $api_key . '.scope',implode(',', $scope)); |
|
80 | + Configure::write('Multidimensional/Shopify.' . $api_key . '.scope', implode(',', $scope)); |
|
81 | 81 | |
82 | 82 | $this->out(''); |
83 | 83 | $isPrivateApp = strtolower($this->in('Is this a private app?', ['y', 'n'])); |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | |
92 | - Configure::write('Multidimensional/Shopify.' . $api_key . '.is_private_app',$is_private_app); |
|
92 | + Configure::write('Multidimensional/Shopify.' . $api_key . '.is_private_app', $is_private_app); |
|
93 | 93 | |
94 | 94 | if ($is_private_app == 'true') { |
95 | - Configure::write('Multidimensional/Shopify.' . $api_key . '.private_app_password',$this->in('Private App Password:')); |
|
95 | + Configure::write('Multidimensional/Shopify.' . $api_key . '.private_app_password', $this->in('Private App Password:')); |
|
96 | 96 | } else { |
97 | 97 | Configure::write('Multidimensional/Shopify.' . $api_key . '.private_app_password', NULL); |
98 | 98 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | $shopEntity = $this->shops->findByMyshopifyDomain($domain)->first(); |
106 | 106 | if ($shopEntity->id) { |
107 | - return (int)$shopEntity->id; |
|
107 | + return (int) $shopEntity->id; |
|
108 | 108 | } else { |
109 | 109 | return false; |
110 | 110 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $query = $this->access_tokens->find(); |
117 | 117 | $query = $query->contain(['Shops']); |
118 | 118 | $query = $query->where(['api_key' => $apiKey, 'token' => $accessToken]); |
119 | - $query = $query->where(function ($exp, $q) { |
|
119 | + $query = $query->where(function($exp, $q) { |
|
120 | 120 | return $exp->isNull('expired_at'); |
121 | 121 | }); |
122 | 122 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $query = $this->access_tokens->find(); |
136 | 136 | $query = $query->contain(['Shops']); |
137 | 137 | $query = $query->where(['api_key' => $apiKey, 'Shops.myshopify_domain' => $shopDomain]); |
138 | - $query = $query->where(function ($exp, $q) { |
|
138 | + $query = $query->where(function($exp, $q) { |
|
139 | 139 | return $exp->isNull('expired_at'); |
140 | 140 | }); |
141 | 141 |
@@ -147,7 +147,7 @@ |
||
147 | 147 | { |
148 | 148 | $params = explode("/", $this->response->getHeaderLine('http_x_shopify_shop_api_call_limit')); |
149 | 149 | |
150 | - return (int)$params[$index]; |
|
150 | + return (int) $params[$index]; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | public function getAuthorizeUrl($shopDomain, $redirectUrl) |