@@ -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;  | 
                                                        
@@ -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>'); | 
                                                        
@@ -17,8 +17,7 @@  | 
                                                    ||
| 17 | 17 | |
| 18 | 18 | use Cake\TestSuite\Fixture\TestFixture;  | 
                                                        
| 19 | 19 | |
| 20 | -class ShopsFixture extends TestFixture  | 
                                                        |
| 21 | -{ | 
                                                        |
| 20 | +class ShopsFixture extends TestFixture { | 
                                                        |
| 22 | 21 | |
| 23 | 22 | public $fields = [  | 
                                                        
| 24 | 23 | 'id' => ['type' => 'integer', 'length' => 11],  | 
                                                        
@@ -17,8 +17,7 @@  | 
                                                    ||
| 17 | 17 | |
| 18 | 18 | use Cake\TestSuite\Fixture\TestFixture;  | 
                                                        
| 19 | 19 | |
| 20 | -class AccessTokensFixture extends TestFixture  | 
                                                        |
| 21 | -{ | 
                                                        |
| 20 | +class AccessTokensFixture extends TestFixture { | 
                                                        |
| 22 | 21 | |
| 23 | 22 | public $fields = [  | 
                                                        
| 24 | 23 | 'id' => ['type' => 'integer', 'length' => 10, 'null' => false],  | 
                                                        
@@ -70,12 +70,12 @@ discard block  | 
                                                    ||
| 70 | 70 | 'shopify_shop_domain_'.$this->ShopifyAPI->api_key => $this->ShopifyAPI->getShopDomain()  | 
                                                        
| 71 | 71 | ]);  | 
                                                        
| 72 | 72 | |
| 73 | - $this->Auth->setUser($shop_entity);  | 
                                                        |
| 73 | + $this->Auth->setUser($shop_entity);  | 
                                                        |
| 74 | 74 | |
| 75 | 75 | return $this->redirect([  | 
                                                        
| 76 | 76 | 'controller' => 'Shopify',  | 
                                                        
| 77 | 77 | 'plugin' => false,  | 
                                                        
| 78 | - 'api_key' => $this->ShopifyAPI->api_key]);  | 
                                                        |
| 78 | + 'api_key' => $this->ShopifyAPI->api_key]);  | 
                                                        |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 |                          } else { | 
                                                        
@@ -109,7 +109,7 @@ discard block  | 
                                                    ||
| 109 | 109 | |
| 110 | 110 |              $this->render('add'); | 
                                                        
| 111 | 111 | |
| 112 | -          } elseif (!empty($this->request->data['shop_domain']) && !$this->error) { | 
                                                        |
| 112 | +            } elseif (!empty($this->request->data['shop_domain']) && !$this->error) { | 
                                                        |
| 113 | 113 | |
| 114 | 114 | $valid_domain = $this->ShopifyAPI->validDomain(  | 
                                                        
| 115 | 115 | $this->request->data['shop_domain']  | 
                                                        
@@ -22,13 +22,11 @@ discard block  | 
                                                    ||
| 22 | 22 | |
| 23 | 23 | use Multidimensional\Shopify\Controller\AppController;  | 
                                                        
| 24 | 24 | |
| 25 | -class InstallController extends AppController  | 
                                                        |
| 26 | -{ | 
                                                        |
| 25 | +class InstallController extends AppController { | 
                                                        |
| 27 | 26 | |
| 28 | 27 | private $error;  | 
                                                        
| 29 | 28 | |
| 30 | - public function initialize()  | 
                                                        |
| 31 | -    { | 
                                                        |
| 29 | +    public function initialize() { | 
                                                        |
| 32 | 30 | |
| 33 | 31 | parent::initialize();  | 
                                                        
| 34 | 32 |          $this->loadComponent('Multidimensional/Shopify.ShopifyDatabase'); | 
                                                        
@@ -96,8 +94,7 @@ discard block  | 
                                                    ||
| 96 | 94 |          $this->render('index'); | 
                                                        
| 97 | 95 | }  | 
                                                        
| 98 | 96 | |
| 99 | - public function index()  | 
                                                        |
| 100 | -    { | 
                                                        |
| 97 | +    public function index() { | 
                                                        |
| 101 | 98 | |
| 102 | 99 |          if (!empty($this->request->query['code']) && !$this->error) { | 
                                                        
| 103 | 100 | |
@@ -135,8 +132,7 @@ discard block  | 
                                                    ||
| 135 | 132 | }  | 
                                                        
| 136 | 133 | }  | 
                                                        
| 137 | 134 | |
| 138 | - public function redirect($url, $status = 302)  | 
                                                        |
| 139 | -    { | 
                                                        |
| 135 | +    public function redirect($url, $status = 302) { | 
                                                        |
| 140 | 136 | |
| 141 | 137 |          $this->set('shopify_auth_url', $url); | 
                                                        
| 142 | 138 |          $this->render('redirect'); |