@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $query = $query->contain(['Shops']); |
114 | 114 | $query = $query->where(['api_key' => $apiKey, 'token' => $accessToken]); |
115 | 115 | $query = $query->where( |
116 | - function ($exp, $q) { |
|
116 | + function($exp, $q) { |
|
117 | 117 | return $exp->isNull('expired_at'); |
118 | 118 | } |
119 | 119 | ); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $query = $query->contain(['Shops']); |
134 | 134 | $query = $query->where(['api_key' => $apiKey, 'Shops.myshopify_domain' => $shopDomain]); |
135 | 135 | $query = $query->where( |
136 | - function ($exp, $q) { |
|
136 | + function($exp, $q) { |
|
137 | 137 | return $exp->isNull('expired_at'); |
138 | 138 | } |
139 | 139 | ); |
@@ -113,7 +113,8 @@ discard block |
||
113 | 113 | $query = $query->contain(['Shops']); |
114 | 114 | $query = $query->where(['api_key' => $apiKey, 'token' => $accessToken]); |
115 | 115 | $query = $query->where( |
116 | - function ($exp, $q) { |
|
116 | + function ($exp, $q) |
|
117 | + { |
|
117 | 118 | return $exp->isNull('expired_at'); |
118 | 119 | } |
119 | 120 | ); |
@@ -133,7 +134,8 @@ discard block |
||
133 | 134 | $query = $query->contain(['Shops']); |
134 | 135 | $query = $query->where(['api_key' => $apiKey, 'Shops.myshopify_domain' => $shopDomain]); |
135 | 136 | $query = $query->where( |
136 | - function ($exp, $q) { |
|
137 | + function ($exp, $q) |
|
138 | + { |
|
137 | 139 | return $exp->isNull('expired_at'); |
138 | 140 | } |
139 | 141 | ); |
@@ -81,7 +81,7 @@ |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | - * @param string $accesstoken |
|
84 | + * @param string $accessToken |
|
85 | 85 | * @param int $shopId |
86 | 86 | * @param string $apiKey |
87 | 87 | * @return array|bool |
@@ -66,7 +66,7 @@ |
||
66 | 66 | $scope = array_map('strtolower', $scope); |
67 | 67 | array_walk( |
68 | 68 | $scope, |
69 | - function (&$value) { |
|
69 | + function(&$value) { |
|
70 | 70 | $value = str_replace(" ", "_", $value); |
71 | 71 | } |
72 | 72 | ); |
@@ -66,7 +66,8 @@ |
||
66 | 66 | $scope = array_map('strtolower', $scope); |
67 | 67 | array_walk( |
68 | 68 | $scope, |
69 | - function (&$value) { |
|
69 | + function (&$value) |
|
70 | + { |
|
70 | 71 | $value = str_replace(" ", "_", $value); |
71 | 72 | } |
72 | 73 | ); |
@@ -51,24 +51,24 @@ |
||
51 | 51 | |
52 | 52 | $scopeArray = |
53 | 53 | ['read_content', |
54 | - 'write_content', |
|
55 | - 'read_themes', |
|
56 | - 'write_themes', |
|
57 | - 'read_products', |
|
58 | - 'write_products', |
|
59 | - 'read_customers', |
|
60 | - 'write_customers', |
|
61 | - 'read_orders', |
|
62 | - 'write_orders', |
|
63 | - 'read_script_tags', |
|
64 | - 'write_script_tags', |
|
65 | - 'read_fulfillments', |
|
66 | - 'write_fulfillments', |
|
67 | - 'read_shipping', |
|
68 | - 'write_shipping', |
|
69 | - 'read_analytics', |
|
70 | - 'read_users', |
|
71 | - 'write_users']; |
|
54 | + 'write_content', |
|
55 | + 'read_themes', |
|
56 | + 'write_themes', |
|
57 | + 'read_products', |
|
58 | + 'write_products', |
|
59 | + 'read_customers', |
|
60 | + 'write_customers', |
|
61 | + 'read_orders', |
|
62 | + 'write_orders', |
|
63 | + 'read_script_tags', |
|
64 | + 'write_script_tags', |
|
65 | + 'read_fulfillments', |
|
66 | + 'write_fulfillments', |
|
67 | + 'read_shipping', |
|
68 | + 'write_shipping', |
|
69 | + 'read_analytics', |
|
70 | + 'read_users', |
|
71 | + 'write_users']; |
|
72 | 72 | |
73 | 73 | $this->out('Enter your application\'s scope here.', 2); |
74 | 74 | $this->out('Valid scope options:', 2); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | /** |
74 | 74 | * @param Request $request |
75 | 75 | * @param Response $response |
76 | - * @return null|Response |
|
76 | + * @return null|string |
|
77 | 77 | */ |
78 | 78 | public function unauthenticated(Request $request, Response $response) |
79 | 79 | { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
187 | - * @return Router |
|
187 | + * @return string |
|
188 | 188 | */ |
189 | 189 | private function _generateLoginUrl() |
190 | 190 | { |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | private $ShopifyAPI; |
32 | 32 | private $ShopifyDatabase; |
33 | 33 | |
34 | - /** |
|
35 | - * @param registry $registry |
|
36 | - * @param array $config |
|
37 | - * @return void |
|
38 | - */ |
|
34 | + /** |
|
35 | + * @param registry $registry |
|
36 | + * @param array $config |
|
37 | + * @return void |
|
38 | + */ |
|
39 | 39 | public function __construct($registry, array $config = []) |
40 | 40 | { |
41 | 41 | parent::__construct($registry, $config); |
@@ -60,21 +60,21 @@ discard block |
||
60 | 60 | $this->ShopifyDatabase = $registry->load('Multidimensional/Cakephpify.ShopifyDatabase'); |
61 | 61 | } |
62 | 62 | |
63 | - /** |
|
64 | - * @param Request $request |
|
65 | - * @param Response $response |
|
66 | - * @return array |
|
67 | - */ |
|
63 | + /** |
|
64 | + * @param Request $request |
|
65 | + * @param Response $response |
|
66 | + * @return array |
|
67 | + */ |
|
68 | 68 | public function authenticate(Request $request, Response $response) |
69 | 69 | { |
70 | 70 | return $this->getUser($request); |
71 | 71 | } |
72 | 72 | |
73 | - /** |
|
74 | - * @param Request $request |
|
75 | - * @param Response $response |
|
76 | - * @return null|Response |
|
77 | - */ |
|
73 | + /** |
|
74 | + * @param Request $request |
|
75 | + * @param Response $response |
|
76 | + * @return null|Response |
|
77 | + */ |
|
78 | 78 | public function unauthenticated(Request $request, Response $response) |
79 | 79 | { |
80 | 80 | if (isset($request->query['hmac']) |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | return $response->location($this->_generateLoginUrl()); |
100 | 100 | } |
101 | 101 | |
102 | - /** |
|
103 | - * @param Request $request |
|
104 | - * @return array|bool |
|
105 | - */ |
|
102 | + /** |
|
103 | + * @param Request $request |
|
104 | + * @return array|bool |
|
105 | + */ |
|
106 | 106 | public function getUser(Request $request) |
107 | 107 | { |
108 | 108 | $accessToken = $request->session()->read('shopify_access_token_' . $this->api_key); |
@@ -144,17 +144,17 @@ discard block |
||
144 | 144 | return false; |
145 | 145 | } |
146 | 146 | |
147 | - /** |
|
148 | - * @param Request $request |
|
149 | - * @return void |
|
150 | - */ |
|
147 | + /** |
|
148 | + * @param Request $request |
|
149 | + * @return void |
|
150 | + */ |
|
151 | 151 | protected function _authenticate(Request $request) |
152 | 152 | { |
153 | 153 | } |
154 | 154 | |
155 | - /** |
|
156 | - * @return array |
|
157 | - */ |
|
155 | + /** |
|
156 | + * @return array |
|
157 | + */ |
|
158 | 158 | public function implementedEvents() |
159 | 159 | { |
160 | 160 | return [ |
@@ -163,29 +163,29 @@ discard block |
||
163 | 163 | ]; |
164 | 164 | } |
165 | 165 | |
166 | - /** |
|
167 | - * @param Event $event |
|
168 | - * @param array $user |
|
169 | - * @return void |
|
170 | - */ |
|
166 | + /** |
|
167 | + * @param Event $event |
|
168 | + * @param array $user |
|
169 | + * @return void |
|
170 | + */ |
|
171 | 171 | public function afterIdentify(Event $event, array $user) |
172 | 172 | { |
173 | 173 | } |
174 | 174 | |
175 | - /** |
|
176 | - * @param Event $event |
|
177 | - * @param array $user |
|
178 | - * @return void |
|
179 | - */ |
|
175 | + /** |
|
176 | + * @param Event $event |
|
177 | + * @param array $user |
|
178 | + * @return void |
|
179 | + */ |
|
180 | 180 | public function logout(Event $event, array $user) |
181 | 181 | { |
182 | 182 | //$request->session()->delete('shopify_access_token_' . $this->api_key); |
183 | 183 | //$request->session()->delete('shopify_shop_domain_' . $this->api_key); |
184 | 184 | } |
185 | 185 | |
186 | - /** |
|
187 | - * @return Router |
|
188 | - */ |
|
186 | + /** |
|
187 | + * @return Router |
|
188 | + */ |
|
189 | 189 | private function _generateLoginUrl() |
190 | 190 | { |
191 | 191 | return Router::url(['controller' => 'Install', 'action' => 'index', 'plugin' => 'Multidimensional/Cakephpify']); |
@@ -36,10 +36,10 @@ |
||
36 | 36 | |
37 | 37 | public $controller = null; |
38 | 38 | |
39 | - /** |
|
40 | - * @param array $config |
|
41 | - * @return void |
|
42 | - */ |
|
39 | + /** |
|
40 | + * @param array $config |
|
41 | + * @return void |
|
42 | + */ |
|
43 | 43 | public function initialize(array $config = []) |
44 | 44 | { |
45 | 45 | parent::initialize($config); |