@@ -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 | { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | /** |
122 | 122 | * @param string $domain |
123 | - * @return int|false |
|
123 | + * @return boolean |
|
124 | 124 | */ |
125 | 125 | public function getShopIdFromDomain($domain) |
126 | 126 | { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | /** |
136 | 136 | * @param string $accessToken |
137 | 137 | * @param string $apiKey |
138 | - * @return array|false |
|
138 | + * @return boolean |
|
139 | 139 | */ |
140 | 140 | public function getShopDataFromAccessToken($accessToken, $apiKey) |
141 | 141 | { |
@@ -124,17 +124,17 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function getShopIdFromDomain($domain) |
126 | 126 | { |
127 | - if (empty($domain)) { |
|
128 | - return false; |
|
129 | - } |
|
127 | + if (empty($domain)) { |
|
128 | + return false; |
|
129 | + } |
|
130 | 130 | |
131 | - $query = $this->shops->findByMyshopifyDomain([$domain]); |
|
131 | + $query = $this->shops->findByMyshopifyDomain([$domain]); |
|
132 | 132 | |
133 | - $shopEntity = $query->first(); |
|
133 | + $shopEntity = $query->first(); |
|
134 | 134 | |
135 | - if ($shopEntity->isEmpty()) { |
|
136 | - return false; |
|
137 | - } |
|
135 | + if ($shopEntity->isEmpty()) { |
|
136 | + return false; |
|
137 | + } |
|
138 | 138 | |
139 | 139 | if ($shopEntity->id) { |
140 | 140 | return (int)$shopEntity->id; |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function getShopDataFromAccessToken($accessToken, $apiKey) |
152 | 152 | { |
153 | - if (empty($accessToken) || empty($apiKey)) { |
|
154 | - return false; |
|
155 | - } |
|
153 | + if (empty($accessToken) || empty($apiKey)) { |
|
154 | + return false; |
|
155 | + } |
|
156 | 156 | |
157 | 157 | $query = $this->access_tokens->find(); |
158 | 158 | $query = $query->contain(['Shops']); |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | |
166 | 166 | $shopEntity = $query->first(); |
167 | 167 | |
168 | - if ($shopEntity->isEmpty()) { |
|
169 | - return false; |
|
170 | - } |
|
168 | + if ($shopEntity->isEmpty()) { |
|
169 | + return false; |
|
170 | + } |
|
171 | 171 | |
172 | - $shopArray = $shopEntity->toArray(); |
|
172 | + $shopArray = $shopEntity->toArray(); |
|
173 | 173 | |
174 | 174 | if (is_array($shopArray['shop'])) { |
175 | 175 | return $shopArray['shop']; |
@@ -185,9 +185,9 @@ discard block |
||
185 | 185 | */ |
186 | 186 | public function getAccessTokenFromShopDomain($shopDomain, $apiKey) |
187 | 187 | { |
188 | - if (empty($shopDomain) || empty($apiKey)) { |
|
189 | - return false; |
|
190 | - } |
|
188 | + if (empty($shopDomain) || empty($apiKey)) { |
|
189 | + return false; |
|
190 | + } |
|
191 | 191 | |
192 | 192 | $query = $this->access_tokens->find(); |
193 | 193 | $query = $query->contain(['Shops']); |
@@ -200,9 +200,9 @@ discard block |
||
200 | 200 | |
201 | 201 | $accessTokenEntity = $query->first(); |
202 | 202 | |
203 | - if ($accessTokenEntity->isEmpty()) { |
|
204 | - return false; |
|
205 | - } |
|
203 | + if ($accessTokenEntity->isEmpty()) { |
|
204 | + return false; |
|
205 | + } |
|
206 | 206 | |
207 | 207 | if ($accessTokenEntity->token) { |
208 | 208 | return $accessTokenEntity->token; |
@@ -67,71 +67,71 @@ |
||
67 | 67 | |
68 | 68 | public function testGetShopIdFromDomain() |
69 | 69 | { |
70 | - //$return = $this->component->getShopIdFromDomain('test.myshopify.com'); |
|
71 | - //$this->assertSame($return, 8675309); |
|
72 | - //$this->assertEquals($return, 8675309); |
|
70 | + //$return = $this->component->getShopIdFromDomain('test.myshopify.com'); |
|
71 | + //$this->assertSame($return, 8675309); |
|
72 | + //$this->assertEquals($return, 8675309); |
|
73 | 73 | |
74 | - $return = $this->component->getShopIdFromDomain('false.myshopify.com'); |
|
75 | - $this->assertFalse($return); |
|
74 | + $return = $this->component->getShopIdFromDomain('false.myshopify.com'); |
|
75 | + $this->assertFalse($return); |
|
76 | 76 | |
77 | - $return = $this->component->getShopIdFromDomain('not-a-domain.com'); |
|
78 | - $this->assertFalse($return); |
|
77 | + $return = $this->component->getShopIdFromDomain('not-a-domain.com'); |
|
78 | + $this->assertFalse($return); |
|
79 | 79 | |
80 | - $return = $this->component->getShopIdFromDomain(null); |
|
81 | - $this->assertFalse($return); |
|
80 | + $return = $this->component->getShopIdFromDomain(null); |
|
81 | + $this->assertFalse($return); |
|
82 | 82 | |
83 | - $return = $this->component->getShopIdFromDomain(true); |
|
84 | - $this->assertFalse($return); |
|
83 | + $return = $this->component->getShopIdFromDomain(true); |
|
84 | + $this->assertFalse($return); |
|
85 | 85 | |
86 | - $return = $this->component->getShopIdFromDomain(false); |
|
87 | - $this->assertFalse($return); |
|
86 | + $return = $this->component->getShopIdFromDomain(false); |
|
87 | + $this->assertFalse($return); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | public function testGetShopDataFromAccessToken() |
91 | 91 | { |
92 | 92 | $return = $this->component->getShopDataFromAccessToken(null, null); |
93 | - $this->assertFalse($return); |
|
93 | + $this->assertFalse($return); |
|
94 | 94 | |
95 | - $return = $this->component->getShopDataFromAccessToken(null, true); |
|
96 | - $this->assertFalse($return); |
|
95 | + $return = $this->component->getShopDataFromAccessToken(null, true); |
|
96 | + $this->assertFalse($return); |
|
97 | 97 | |
98 | - $return = $this->component->getShopDataFromAccessToken(true, null); |
|
99 | - $this->assertFalse($return); |
|
98 | + $return = $this->component->getShopDataFromAccessToken(true, null); |
|
99 | + $this->assertFalse($return); |
|
100 | 100 | |
101 | - $return = $this->component->getShopDataFromAccessToken(null, false); |
|
102 | - $this->assertFalse($return); |
|
101 | + $return = $this->component->getShopDataFromAccessToken(null, false); |
|
102 | + $this->assertFalse($return); |
|
103 | 103 | |
104 | - $return = $this->component->getShopDataFromAccessToken(false, null); |
|
105 | - $this->assertFalse($return); |
|
104 | + $return = $this->component->getShopDataFromAccessToken(false, null); |
|
105 | + $this->assertFalse($return); |
|
106 | 106 | |
107 | - $return = $this->component->getShopDataFromAccessToken(false, false); |
|
108 | - $this->assertFalse($return); |
|
107 | + $return = $this->component->getShopDataFromAccessToken(false, false); |
|
108 | + $this->assertFalse($return); |
|
109 | 109 | |
110 | - $return = $this->component->getShopDataFromAccessToken(true, true); |
|
111 | - $this->assertFalse($return); |
|
110 | + $return = $this->component->getShopDataFromAccessToken(true, true); |
|
111 | + $this->assertFalse($return); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | public function testGetAccessTokenFromShopDomain() |
115 | 115 | { |
116 | 116 | $return = $this->component->getAccessTokenFromShopDomain(null, null); |
117 | - $this->assertFalse($return); |
|
117 | + $this->assertFalse($return); |
|
118 | 118 | |
119 | - $return = $this->component->getAccessTokenFromShopDomain(null, true); |
|
120 | - $this->assertFalse($return); |
|
119 | + $return = $this->component->getAccessTokenFromShopDomain(null, true); |
|
120 | + $this->assertFalse($return); |
|
121 | 121 | |
122 | - $return = $this->component->getAccessTokenFromShopDomain(true, null); |
|
123 | - $this->assertFalse($return); |
|
122 | + $return = $this->component->getAccessTokenFromShopDomain(true, null); |
|
123 | + $this->assertFalse($return); |
|
124 | 124 | |
125 | - $return = $this->component->getAccessTokenFromShopDomain(null, false); |
|
126 | - $this->assertFalse($return); |
|
125 | + $return = $this->component->getAccessTokenFromShopDomain(null, false); |
|
126 | + $this->assertFalse($return); |
|
127 | 127 | |
128 | - $return = $this->component->getAccessTokenFromShopDomain(false, null); |
|
129 | - $this->assertFalse($return); |
|
128 | + $return = $this->component->getAccessTokenFromShopDomain(false, null); |
|
129 | + $this->assertFalse($return); |
|
130 | 130 | |
131 | - $return = $this->component->getAccessTokenFromShopDomain(false, false); |
|
132 | - $this->assertFalse($return); |
|
131 | + $return = $this->component->getAccessTokenFromShopDomain(false, false); |
|
132 | + $this->assertFalse($return); |
|
133 | 133 | |
134 | - $return = $this->component->getAccessTokenFromShopDomain(true, true); |
|
135 | - $this->assertFalse($return); |
|
134 | + $return = $this->component->getAccessTokenFromShopDomain(true, true); |
|
135 | + $this->assertFalse($return); |
|
136 | 136 | } |
137 | 137 | } |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | { |
29 | 29 | parent::setUp(); |
30 | 30 | |
31 | - $this->out = new ConsoleOutput(); |
|
31 | + $this->out = new ConsoleOutput(); |
|
32 | 32 | $io = new ConsoleIo($this->out); |
33 | 33 | $this->Shell = $this->getMockBuilder('ShopifyInstallShell') |
34 | 34 | ->setMethods(['in', 'err', '_stop', 'clear']) |
35 | 35 | ->setConstructorArgs([$io]) |
36 | 36 | ->getMock(); |
37 | - } |
|
37 | + } |
|
38 | 38 | |
39 | 39 | public function tearDown() |
40 | 40 | { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function testMain() |
46 | 46 | { |
47 | 47 | $this->markTestIncomplete('Not implemented yet.'); |
48 | - /*$this->Shell->main(); |
|
48 | + /*$this->Shell->main(); |
|
49 | 49 | $output = $this->out->messages(); |
50 | 50 | $expected = "/(.*)/"; |
51 | 51 | $this->assertRegExp($expected, $output); |