Skip to content

Commit

Permalink
Merge pull request #1072 from nexcess/scrutinizer-patch-2
Browse files Browse the repository at this point in the history
Scrutinizer Auto-Fixes
  • Loading branch information
miguelbalparda committed Jan 14, 2016
2 parents abb5b94 + e7a3244 commit b6ca483
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions app/code/community/Nexcessnet/Turpentine/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,16 @@ public function getChildBlockNames($blockNode) {
* @param string|object $model
* @return string
*/
public function getModelName( $model ) {
if( is_object( $model ) ) {
$model = get_class( $model );
public function getModelName($model) {
if (is_object($model)) {
$model = get_class($model);
}
// This guess may work if the extension uses its lowercased name as model group name.
$result = strtolower( preg_replace(
'~^[^_]+_([^_]+)_Model_(.+)$~', '$1/$2', $model ) );
$result = strtolower(preg_replace(
'~^[^_]+_([^_]+)_Model_(.+)$~', '$1/$2', $model ));
// This check is not expensive because the answer should come from Magento's classNameCache
$checkModel = Mage::getConfig()->getModelClassName($result);
if ( 'Mage_' == substr($checkModel,0,5) && !class_exists($result) ) {
if ('Mage_' == substr($checkModel, 0, 5) && ! class_exists($result)) {
// Fallback to full model name.
$result = $model;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function addProductListToolbarRewrite($eventObject) {
*/
public function fixCmRedisSessionLocks($eventObject) {
if (Mage::helper('core')->isModuleEnabled('Cm_RedisSession')) {
if (!empty($_COOKIE['frontend']) && 'crawler-session' == $_COOKIE['frontend']) {
if ( ! empty($_COOKIE['frontend']) && 'crawler-session' == $_COOKIE['frontend']) {
define('CM_REDISSESSION_LOCKING_ENABLED', false);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* User: [email protected]
* Date: 08/01/14
*/
* User: [email protected]
* Date: 08/01/14
*/

require_once Mage::getModuleDir('controllers', 'Mage_Adminhtml').DS.'CacheController.php';

Expand Down

0 comments on commit b6ca483

Please sign in to comment.