@@ -17,16 +17,14 @@ |
||
| 17 | 17 | |
| 18 | 18 | use App\Controller\AppController as BaseController; |
| 19 | 19 | |
| 20 | -class AppController extends BaseController |
|
| 21 | -{ |
|
| 20 | +class AppController extends BaseController { |
|
| 22 | 21 | |
| 23 | 22 | /** |
| 24 | 23 | * Initialize AppController |
| 25 | 24 | * |
| 26 | 25 | * @return void |
| 27 | 26 | */ |
| 28 | - public function initialize() |
|
| 29 | - { |
|
| 27 | + public function initialize() { |
|
| 30 | 28 | parent::initialize(); |
| 31 | 29 | $this->loadComponent('Flash'); |
| 32 | 30 | } |
@@ -68,8 +68,7 @@ |
||
| 68 | 68 | * @property bool $setup_required |
| 69 | 69 | * @property bool $force_ssl |
| 70 | 70 | */ |
| 71 | -class Shop extends Entity |
|
| 72 | -{ |
|
| 71 | +class Shop extends Entity { |
|
| 73 | 72 | |
| 74 | 73 | /** |
| 75 | 74 | * Fields that can be mass assigned using newEntity() or patchEntity(). |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | * @property \Cake\I18n\Time $updated_at |
| 28 | 28 | * @property \Cake\I18n\Time $expired_at |
| 29 | 29 | */ |
| 30 | -class AccessToken extends Entity |
|
| 31 | -{ |
|
| 30 | +class AccessToken extends Entity { |
|
| 32 | 31 | |
| 33 | 32 | /** |
| 34 | 33 | * Fields that can be mass assigned using newEntity() or patchEntity(). |
@@ -31,8 +31,7 @@ discard block |
||
| 31 | 31 | * @method \Shopify\Model\Entity\AccessToken[] patchEntities($entities, array $data, array $options = []) |
| 32 | 32 | * @method \Shopify\Model\Entity\AccessToken findOrCreate($search, callable $callback = null) |
| 33 | 33 | */ |
| 34 | -class AccessTokensTable extends Table |
|
| 35 | -{ |
|
| 34 | +class AccessTokensTable extends Table { |
|
| 36 | 35 | |
| 37 | 36 | /** |
| 38 | 37 | * Initialize method |
@@ -40,8 +39,7 @@ discard block |
||
| 40 | 39 | * @param array $config The configuration for the Table. |
| 41 | 40 | * @return void |
| 42 | 41 | */ |
| 43 | - public function initialize(array $config) |
|
| 44 | - { |
|
| 42 | + public function initialize(array $config) { |
|
| 45 | 43 | parent::initialize($config); |
| 46 | 44 | |
| 47 | 45 | //$this->table('access_tokens'); |
@@ -58,8 +56,7 @@ discard block |
||
| 58 | 56 | * @param \Cake\Validation\Validator $validator Validator instance. |
| 59 | 57 | * @return \Cake\Validation\Validator |
| 60 | 58 | */ |
| 61 | - public function validationDefault(Validator $validator) |
|
| 62 | - { |
|
| 59 | + public function validationDefault(Validator $validator) { |
|
| 63 | 60 | $validator |
| 64 | 61 | ->integer('id') |
| 65 | 62 | ->allowEmpty('id', 'create'); |
@@ -101,8 +98,7 @@ discard block |
||
| 101 | 98 | * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. |
| 102 | 99 | * @return \Cake\ORM\RulesChecker |
| 103 | 100 | */ |
| 104 | - public function buildRules(RulesChecker $rules) |
|
| 105 | - { |
|
| 101 | + public function buildRules(RulesChecker $rules) { |
|
| 106 | 102 | $rules->add($rules->isUnique(['token'])); |
| 107 | 103 | |
| 108 | 104 | return $rules; |
@@ -31,8 +31,7 @@ discard block |
||
| 31 | 31 | * @method \App\Model\Entity\Shop[] patchEntities($entities, array $data, array $options = []) |
| 32 | 32 | * @method \App\Model\Entity\Shop findOrCreate($search, callable $callback = null) |
| 33 | 33 | */ |
| 34 | -class ShopsTable extends Table |
|
| 35 | -{ |
|
| 34 | +class ShopsTable extends Table { |
|
| 36 | 35 | |
| 37 | 36 | /** |
| 38 | 37 | * Initialize method |
@@ -40,8 +39,7 @@ discard block |
||
| 40 | 39 | * @param array $config The configuration for the Table. |
| 41 | 40 | * @return void |
| 42 | 41 | */ |
| 43 | - public function initialize(array $config) |
|
| 44 | - { |
|
| 42 | + public function initialize(array $config) { |
|
| 45 | 43 | parent::initialize($config); |
| 46 | 44 | |
| 47 | 45 | //$this->table('shops'); |
@@ -60,8 +58,7 @@ discard block |
||
| 60 | 58 | * @param \Cake\Validation\Validator $validator Validator instance. |
| 61 | 59 | * @return \Cake\Validation\Validator |
| 62 | 60 | */ |
| 63 | - public function validationDefault(Validator $validator) |
|
| 64 | - { |
|
| 61 | + public function validationDefault(Validator $validator) { |
|
| 65 | 62 | $validator |
| 66 | 63 | ->integer('id') |
| 67 | 64 | ->allowEmpty('id', 'create'); |
@@ -258,8 +255,7 @@ discard block |
||
| 258 | 255 | * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. |
| 259 | 256 | * @return \Cake\ORM\RulesChecker |
| 260 | 257 | */ |
| 261 | - public function buildRules(RulesChecker $rules) |
|
| 262 | - { |
|
| 258 | + public function buildRules(RulesChecker $rules) { |
|
| 263 | 259 | $rules->add($rules->isUnique(['email'])); |
| 264 | 260 | |
| 265 | 261 | return $rules; |
@@ -18,11 +18,9 @@ |
||
| 18 | 18 | use Cake\Console\Shell; |
| 19 | 19 | use Cake\Console\Helper; |
| 20 | 20 | |
| 21 | -class TableHelper extends Helper |
|
| 22 | -{ |
|
| 21 | +class TableHelper extends Helper { |
|
| 23 | 22 | |
| 24 | - public function output($data, $columns = 10, $terminal_width = 80) |
|
| 25 | - { |
|
| 23 | + public function output($data, $columns = 10, $terminal_width = 80) { |
|
| 26 | 24 | while((count($data)%$columns != 0) && ($columns > 5)) { |
| 27 | 25 | $columns--; |
| 28 | 26 | } |
@@ -17,10 +17,8 @@ |
||
| 17 | 17 | |
| 18 | 18 | use Cake\Console\Helper; |
| 19 | 19 | |
| 20 | -class HeaderHelper extends Helper |
|
| 21 | -{ |
|
| 22 | - public function output($args = null) |
|
| 23 | - { |
|
| 20 | +class HeaderHelper extends Helper { |
|
| 21 | + public function output($args = null) { |
|
| 24 | 22 | $this->_io->out("\n\n"); |
| 25 | 23 | $this->_io->styles('header', ['text' => 'green']); |
| 26 | 24 | $this->_io->out('<header> _____ __ ______ ____ ____________ __</header>'); |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | |
| 100 | 100 | $this->out(''); |
| 101 | 101 | |
| 102 | - if (($first_run) || (strtolower($this->in('Update Database?', ['y','n'])) == 'y')) { |
|
| 102 | + if (($first_run) || (strtolower($this->in('Update Database?', ['y','n'])) == 'y')) { |
|
| 103 | 103 | |
| 104 | 104 | $this->out(''); |
| 105 | 105 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | if (isset($request->query['code'])) { |
| 98 | 98 | $accessToken = $this->ShopifyAPI->getAccessToken($shopDomain, $request->query['code']); |
| 99 | - } else { |
|
| 99 | + } else { |
|
| 100 | 100 | $accessToken = $this->ShopifyDatabase->getAccessTokenFromShopDomain($shopDomain, $this->api_key); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $shop = $this->ShopifyDatabase->getShopDataFromAccessToken($accessToken, $this->api_key); |
| 115 | 115 | |
| 116 | - if($shop && is_array($shop)){ |
|
| 116 | + if($shop && is_array($shop)) { |
|
| 117 | 117 | return ['id' => $shop['id'], 'username' => $shop['myshopify_domain']]; |
| 118 | 118 | } |
| 119 | 119 | |