From c7feacde0d8f362caf9377f751eba71c92ed0d49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Sep 2024 06:39:29 +0000 Subject: [PATCH 1/2] Bump friendsofphp/php-cs-fixer from 3.62.0 to 3.64.0 Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.62.0 to 3.64.0. - [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases) - [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md) - [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.62.0...v3.64.0) --- updated-dependencies: - dependency-name: friendsofphp/php-cs-fixer dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.lock | 72 +++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/composer.lock b/composer.lock index 6cea8bdb..06bf2b3f 100644 --- a/composer.lock +++ b/composer.lock @@ -335,16 +335,16 @@ }, { "name": "symfony/console", - "version": "v5.4.42", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" + "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "url": "https://api.github.com/repos/symfony/console/zipball/e86f8554de667c16dde8aeb89a3990cfde924df9", + "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9", "shasum": "" }, "require": { @@ -414,7 +414,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.42" + "source": "https://github.com/symfony/console/tree/v5.4.43" }, "funding": [ { @@ -430,7 +430,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:21:55+00:00" + "time": "2024-08-13T16:31:56+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1058,16 +1058,16 @@ }, { "name": "symfony/string", - "version": "v6.4.10", + "version": "v6.4.11", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ccf9b30251719567bfd46494138327522b9a9446" + "reference": "5bc3eb632cf9c8dbfd6529d89be9950d1518883b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ccf9b30251719567bfd46494138327522b9a9446", - "reference": "ccf9b30251719567bfd46494138327522b9a9446", + "url": "https://api.github.com/repos/symfony/string/zipball/5bc3eb632cf9c8dbfd6529d89be9950d1518883b", + "reference": "5bc3eb632cf9c8dbfd6529d89be9950d1518883b", "shasum": "" }, "require": { @@ -1124,7 +1124,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.10" + "source": "https://github.com/symfony/string/tree/v6.4.11" }, "funding": [ { @@ -1140,7 +1140,7 @@ "type": "tidelift" } ], - "time": "2024-07-22T10:21:14+00:00" + "time": "2024-08-12T09:55:28+00:00" } ], "packages-dev": [ @@ -1395,16 +1395,16 @@ }, { "name": "composer/pcre", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "1637e067347a0c40bbb1e3cd786b20dcab556a81" + "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/1637e067347a0c40bbb1e3cd786b20dcab556a81", - "reference": "1637e067347a0c40bbb1e3cd786b20dcab556a81", + "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", "shasum": "" }, "require": { @@ -1454,7 +1454,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.0" + "source": "https://github.com/composer/pcre/tree/3.3.1" }, "funding": [ { @@ -1470,7 +1470,7 @@ "type": "tidelift" } ], - "time": "2024-08-19T19:43:53+00:00" + "time": "2024-08-27T18:44:43+00:00" }, { "name": "composer/semver", @@ -1777,16 +1777,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { @@ -1826,7 +1826,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" }, "funding": [ { @@ -1834,20 +1834,20 @@ "type": "github" } ], - "time": "2024-02-07T09:43:46+00:00" + "time": "2024-08-06T10:04:20+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.62.0", + "version": "v3.64.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "627692f794d35c43483f34b01d94740df2a73507" + "reference": "58dd9c931c785a79739310aef5178928305ffa67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/627692f794d35c43483f34b01d94740df2a73507", - "reference": "627692f794d35c43483f34b01d94740df2a73507", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/58dd9c931c785a79739310aef5178928305ffa67", + "reference": "58dd9c931c785a79739310aef5178928305ffa67", "shasum": "" }, "require": { @@ -1929,7 +1929,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.62.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.64.0" }, "funding": [ { @@ -1937,7 +1937,7 @@ "type": "github" } ], - "time": "2024-08-07T17:03:09+00:00" + "time": "2024-08-30T23:09:38+00:00" }, { "name": "joomla/joomla-cms", @@ -3624,16 +3624,16 @@ }, { "name": "symfony/finder", - "version": "v7.1.3", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "717c6329886f32dc65e27461f80f2a465412fdca" + "reference": "d95bbf319f7d052082fb7af147e0f835a695e823" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/717c6329886f32dc65e27461f80f2a465412fdca", - "reference": "717c6329886f32dc65e27461f80f2a465412fdca", + "url": "https://api.github.com/repos/symfony/finder/zipball/d95bbf319f7d052082fb7af147e0f835a695e823", + "reference": "d95bbf319f7d052082fb7af147e0f835a695e823", "shasum": "" }, "require": { @@ -3668,7 +3668,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.3" + "source": "https://github.com/symfony/finder/tree/v7.1.4" }, "funding": [ { @@ -3684,7 +3684,7 @@ "type": "tidelift" } ], - "time": "2024-07-24T07:08:44+00:00" + "time": "2024-08-13T14:28:19+00:00" }, { "name": "symfony/options-resolver", From 33e533220425fc2a9886520899b53492f608b8ad Mon Sep 17 00:00:00 2001 From: Charley Wu Date: Sun, 1 Sep 2024 15:19:07 +0800 Subject: [PATCH 2/2] Fix coding styles --- .../components/com_magebridge/helpers/update.php | 2 +- .../com_magebridge/views/element/view.ajax.php | 2 +- .../com_magebridge/libraries/Zend/Json/Decoder.php | 2 +- .../Yireo/MageBridge/Block/Settings/Joomla.php | 2 +- .../code/community/Yireo/MageBridge/Helper/User.php | 2 +- .../code/community/Yireo/MageBridge/Model/Api.php | 4 ++-- .../code/community/Yireo/MageBridge/Model/Block.php | 10 +++++----- .../community/Yireo/MageBridge/Model/Breadcrumbs.php | 6 +++--- .../Yireo/MageBridge/Model/Customer/Api.php | 2 +- .../code/community/Yireo/MageBridge/Model/Debug.php | 2 +- .../community/Yireo/MageBridge/Model/Product/Api.php | 2 +- .../Yireo/MageBridge/Model/Rewrite/Customer.php | 2 +- .../MageBridge/Model/Rewrite/Message/Collection.php | 2 +- .../code/community/Yireo/MageBridge/Model/Search.php | 2 +- .../code/community/Yireo/MageBridge/Model/Url.php | 2 +- .../code/community/Yireo/MageBridge/Model/User.php | 12 ++++++------ .../community/Yireo/MageBridge/Model/User/Api.php | 8 ++++---- .../MageBridge/controllers/MagebridgeController.php | 2 +- magento/magebridge.php | 2 +- 19 files changed, 34 insertions(+), 34 deletions(-) diff --git a/joomla/administrator/components/com_magebridge/helpers/update.php b/joomla/administrator/components/com_magebridge/helpers/update.php index 9cd3c623..4460e3b6 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 ffca7a16..b7a249c5 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 a92c478b..aad4652d 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 69386c1a..970542f0 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 71ed81e0..a882ea03 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 132a31d0..63686262 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 d86018c1..f2ff8277 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 d49e31fa..28d5bdec 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 4492b98d..27307f5c 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 f74a4be8..901ab5dd 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 482f2583..4af0a2ca 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 e11e1c1c..a61186dc 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 0ff616fa..0e151931 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 6bb4b70c..d18199e2 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 5b1e3e27..d94f2ff7 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 3983b7e6..d072e2fa 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 f20eba89..1e790aca 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 e70640cd..c5700cfe 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 06b0d6c6..79b5b7b2 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)) {