diff --git a/joomla/administrator/components/com_magebridge/helpers/update.php b/joomla/administrator/components/com_magebridge/helpers/update.php index 9cd3c623b..4460e3b6a 100644 --- a/joomla/administrator/components/com_magebridge/helpers/update.php +++ b/joomla/administrator/components/com_magebridge/helpers/update.php @@ -43,7 +43,7 @@ public static function getComponentVersion() */ public static function getCurrentVersion($package) { - switch($package['type']) { + switch ($package['type']) { case 'component': $file = JPATH_ADMINISTRATOR.'/components/'.$package['name'].'/com_magebridge.xml'; break; diff --git a/joomla/administrator/components/com_magebridge/views/element/view.ajax.php b/joomla/administrator/components/com_magebridge/views/element/view.ajax.php index ffca7a16d..b7a249c52 100644 --- a/joomla/administrator/components/com_magebridge/views/element/view.ajax.php +++ b/joomla/administrator/components/com_magebridge/views/element/view.ajax.php @@ -34,7 +34,7 @@ public function display($tpl = null) $layoutType = $this->app->input->getCmd('type'); // Determine the layout and data - switch($layoutType) { + switch ($layoutType) { case 'product': $this->doProductLayout(); break; diff --git a/joomla/components/com_magebridge/libraries/Zend/Json/Decoder.php b/joomla/components/com_magebridge/libraries/Zend/Json/Decoder.php index a92c478bb..aad4652d2 100644 --- a/joomla/components/com_magebridge/libraries/Zend/Json/Decoder.php +++ b/joomla/components/com_magebridge/libraries/Zend/Json/Decoder.php @@ -346,7 +346,7 @@ protected function _getNextToken() case ':': $this->_token = self::COLON; break; - case '"': + case '"': $result = ''; do { $i++; diff --git a/magento/app/code/community/Yireo/MageBridge/Block/Settings/Joomla.php b/magento/app/code/community/Yireo/MageBridge/Block/Settings/Joomla.php index 69386c1ac..970542f03 100644 --- a/magento/app/code/community/Yireo/MageBridge/Block/Settings/Joomla.php +++ b/magento/app/code/community/Yireo/MageBridge/Block/Settings/Joomla.php @@ -47,7 +47,7 @@ public function getApiDetails() foreach ($rows as $row) { $key = $row['scope'].'-'.$row['scope_id']; if (!isset($details[$key])) { - switch($row['scope']) { + switch ($row['scope']) { case 'websites': $scope_name = Mage::app()->getWebsite($row['scope_id'])->getName().' ['.$row['scope'].']'; break; diff --git a/magento/app/code/community/Yireo/MageBridge/Helper/User.php b/magento/app/code/community/Yireo/MageBridge/Helper/User.php index 71ed81e06..a882ea03e 100644 --- a/magento/app/code/community/Yireo/MageBridge/Helper/User.php +++ b/magento/app/code/community/Yireo/MageBridge/Helper/User.php @@ -80,7 +80,7 @@ public function saveUserMap($data) try { $map->save(); - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->trace('Failed to save map', $e->getMessage()); } diff --git a/magento/app/code/community/Yireo/MageBridge/Model/Api.php b/magento/app/code/community/Yireo/MageBridge/Model/Api.php index 132a31d02..636862627 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/Api.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/Api.php @@ -55,7 +55,7 @@ public function getResult($resourcePath, $arguments = null) try { $apiModel = Mage::getModel($apiClass); - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to instantiate API-class '.$apiClass.': '.$e->getMessage()); return false; } @@ -71,7 +71,7 @@ public function getResult($resourcePath, $arguments = null) Mage::getSingleton('magebridge/debug')->notice('API class "'.$apiClass.'" has no method '.$apiMethod); return false; } - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to call API: '.$resourcePath.': '.$e->getMessage()); return false; } diff --git a/magento/app/code/community/Yireo/MageBridge/Model/Block.php b/magento/app/code/community/Yireo/MageBridge/Model/Block.php index d86018c17..f2ff82778 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/Block.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/Block.php @@ -31,7 +31,7 @@ public function init() if (Mage::getSingleton('magebridge/core')->getMetaData('app') == 1) { $controller->getAction()->getLayout()->getUpdate()->addHandle('magebridge_backend'); } - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to load controller: '.$e->getMessage()); return false; } @@ -72,7 +72,7 @@ public function getBlock($block_name = '') try { $block = $controller->getAction()->getLayout()->getBlock($block_name); $instances[$block_name] = $block; - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to get block: '.$block_name.': '.$e->getMessage()); return false; } @@ -114,7 +114,7 @@ public function getBlockByType($block_name = '', $block_type = '') try { $block = $controller->getAction()->getLayout()->createBlock($block_type); $instances[$block_name] = $block; - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to get block: type '.$block_type.': '.$e->getMessage()); } @@ -236,7 +236,7 @@ public function getBlockOutput($block_name, $arguments = []) // Get the HTML of the block-object try { return $block->toHtml(); - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to get html from block '.$block_name.': '.$e->getMessage()); } @@ -296,7 +296,7 @@ public function filter($html = '') if (!empty($processor)) { try { $new_html = $processor->filter($html); - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Template filter failed: '.$e->getMessage()); } diff --git a/magento/app/code/community/Yireo/MageBridge/Model/Breadcrumbs.php b/magento/app/code/community/Yireo/MageBridge/Model/Breadcrumbs.php index d49e31fa0..28d5bdec3 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/Breadcrumbs.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/Breadcrumbs.php @@ -38,14 +38,14 @@ public static function getBreadcrumbs() try { $controller = Mage::getSingleton('magebridge/core')->getController(); $controller->getResponse()->clearBody(); - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to load controller: '.$e->getMessage()); return false; } try { $block = $controller->getAction()->getLayout()->getBlock('breadcrumbs'); - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to get breadcrumbs: '.$e->getMessage()); return false; } @@ -62,7 +62,7 @@ public static function getBreadcrumbs() return $crumbs; } - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to set block: '.$e->getMessage()); return false; } diff --git a/magento/app/code/community/Yireo/MageBridge/Model/Customer/Api.php b/magento/app/code/community/Yireo/MageBridge/Model/Customer/Api.php index 4492b98d7..27307f5cf 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/Customer/Api.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/Customer/Api.php @@ -56,7 +56,7 @@ public function items($arguments = null) // Set ordering if (isset($arguments['ordering'])) { - switch($arguments['ordering']) { + switch ($arguments['ordering']) { case 'newest': $collection->setOrder('created_at', 'desc'); break; diff --git a/magento/app/code/community/Yireo/MageBridge/Model/Debug.php b/magento/app/code/community/Yireo/MageBridge/Model/Debug.php index f74a4be8e..901ab5dd3 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/Debug.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/Debug.php @@ -43,7 +43,7 @@ function Yireo_MageBridge_ErrorHandler($errno, $errstr, $errfile, $errline) $close_bridge = false; // Handle each error-type differently - switch($errno) { + switch ($errno) { // With errors, we need to close the bridge and exit case E_ERROR: case E_USER_ERROR: diff --git a/magento/app/code/community/Yireo/MageBridge/Model/Product/Api.php b/magento/app/code/community/Yireo/MageBridge/Model/Product/Api.php index 482f25837..4af0a2ca8 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/Product/Api.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/Product/Api.php @@ -326,7 +326,7 @@ protected function applyOrdering(&$collection) } // Set ordering - switch($this->arguments['ordering']) { + switch ($this->arguments['ordering']) { case 'newest': $collection->setOrder('created_at', 'desc'); return; diff --git a/magento/app/code/community/Yireo/MageBridge/Model/Rewrite/Customer.php b/magento/app/code/community/Yireo/MageBridge/Model/Rewrite/Customer.php index e11e1c1c5..a61186dc6 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/Rewrite/Customer.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/Rewrite/Customer.php @@ -27,7 +27,7 @@ public function authenticate($username, $password) $rt = false; try { $rt = parent::authenticate($username, $password); - } catch(Exception $e) { + } catch (Exception $e) { $rt = false; } diff --git a/magento/app/code/community/Yireo/MageBridge/Model/Rewrite/Message/Collection.php b/magento/app/code/community/Yireo/MageBridge/Model/Rewrite/Message/Collection.php index 0ff616fa3..0e1519312 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/Rewrite/Message/Collection.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/Rewrite/Message/Collection.php @@ -25,7 +25,7 @@ public function addMessage(Mage_Core_Model_Message_Abstract $message) // Only do this for MB, not Magento standalone if (Mage::getSingleton('magebridge/core')->getMetaData('enable_messages') == 1) { $text = base64_encode($message->getCode()); - switch($message->getType()) { + switch ($message->getType()) { case 'error': header('X-MageBridge-Error: '.$text); break; diff --git a/magento/app/code/community/Yireo/MageBridge/Model/Search.php b/magento/app/code/community/Yireo/MageBridge/Model/Search.php index 6bb4b70c4..d18199e26 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/Search.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/Search.php @@ -98,7 +98,7 @@ public function getResult($text, $searchFields = []) // Return the collection return $collection; - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error($e->getMessage()); return false; } diff --git a/magento/app/code/community/Yireo/MageBridge/Model/Url.php b/magento/app/code/community/Yireo/MageBridge/Model/Url.php index 5b1e3e27e..d94f2ff70 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/Url.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/Url.php @@ -36,7 +36,7 @@ public function getData($type = 'product', $id = null) $magebridge = Mage::getSingleton('magebridge/core'); $urls[$type] = []; - switch($type) { + switch ($type) { case 'category': $categories = Mage::getModel('catalog/category')->getTreeModel(); $helper = Mage::helper('catalog/category'); diff --git a/magento/app/code/community/Yireo/MageBridge/Model/User.php b/magento/app/code/community/Yireo/MageBridge/Model/User.php index 3983b7e60..d072e2fa5 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/User.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/User.php @@ -130,7 +130,7 @@ public function doSSO() $app = Mage::app()->getRequest()->getQuery('app'); if (!empty($sso) && !empty($app)) { - switch($sso) { + switch ($sso) { case 'logout': $this->doSSOLogout($app); return true; @@ -340,7 +340,7 @@ public function login($data = []) $data['password'] = Mage::helper('magebridge/encryption')->decrypt($data['password'], 'customer password'); // Determine whether to do a backend or a frontend login - switch($data['application']) { + switch ($data['application']) { case 'admin': return $this->loginAdmin($data); @@ -366,7 +366,7 @@ private function loginCustomer($data = []) try { $session = Mage::getSingleton('customer/session'); - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to start customer session'); return $data; } @@ -388,7 +388,7 @@ private function loginCustomer($data = []) Mage::getSingleton('magebridge/debug')->error('Login failed'); $data['state'] = MAGEBRIDGE_AUTHENTICATION_FAILURE; } - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to login customer "'.$username.'": '.$e->getMessage()); $data['state'] = MAGEBRIDGE_AUTHENTICATION_ERROR; return $data; @@ -435,7 +435,7 @@ private function loginAdmin($data) Mage::getSingleton('magebridge/debug')->error('Admin login failed'); $data['state'] = MAGEBRIDGE_AUTHENTICATION_FAILURE; } - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to login admin: '.$e->getMessage()); $data['state'] = MAGEBRIDGE_AUTHENTICATION_ERROR; return $data; @@ -463,7 +463,7 @@ public function logout($data) $session = Mage::getSingleton('customer/session'); $session->logout(); $data['state'] = 0; - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to logout customer: '.$e->getMessage()); $data['state'] = 2; } diff --git a/magento/app/code/community/Yireo/MageBridge/Model/User/Api.php b/magento/app/code/community/Yireo/MageBridge/Model/User/Api.php index f20eba890..1e790aca5 100644 --- a/magento/app/code/community/Yireo/MageBridge/Model/User/Api.php +++ b/magento/app/code/community/Yireo/MageBridge/Model/User/Api.php @@ -146,7 +146,7 @@ public function saveCustomer($data = []) // Get the current password-hash $data['hash'] = $customer->getPasswordHash(); - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to load customer: '.$e->getMessage()); } @@ -154,7 +154,7 @@ public function saveCustomer($data = []) if (!empty($customer)) { try { $this->saveAddress($customer, $data); - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to save customer address: '.$e->getMessage()); } } @@ -225,7 +225,7 @@ public function saveAdminUser($data = []) if ($user->save() == false) { Mage::getSingleton('magebridge/debug')->error('Failed to save admin-user '.$user->getEmail()); } - } catch(Exception $e) { + } catch (Exception $e) { Mage::getSingleton('magebridge/debug')->error('Failed to load admin-user: '.$e->getMessage()); } @@ -365,7 +365,7 @@ public function login($data = []) $data['email'] = stripslashes($data['email']); // Determine whether to do a backend or a frontend login - switch($data['application']) { + switch ($data['application']) { case 'admin': // SSI in the backend is not needed (yet) break; diff --git a/magento/app/code/community/Yireo/MageBridge/controllers/MagebridgeController.php b/magento/app/code/community/Yireo/MageBridge/controllers/MagebridgeController.php index e70640cd4..c5700cfe3 100644 --- a/magento/app/code/community/Yireo/MageBridge/controllers/MagebridgeController.php +++ b/magento/app/code/community/Yireo/MageBridge/controllers/MagebridgeController.php @@ -134,7 +134,7 @@ public function wipelogAction() { @mkdir(BP.DS.'var'.DS.'log'); $type = $this->getRequest()->getParam('type'); - switch($type) { + switch ($type) { case 'system': $file = BP.DS.'var'.DS.'log'.DS.'system.log'; break; diff --git a/magento/magebridge.php b/magento/magebridge.php index 06b0d6c61..79b5b7b2d 100644 --- a/magento/magebridge.php +++ b/magento/magebridge.php @@ -119,7 +119,7 @@ function yireo_benchmark($title) // Benchmarking yireo_benchmark('Mage::app()'); -} catch(Exception $e) { +} catch (Exception $e) { // Debugging $debug = Mage::getSingleton('magebridge/debug'); if (!empty($debug)) {