@@ -21,7 +21,7 @@ |
||
| 21 | 21 | class EbayEnterprise_Address_Block_Suggestions extends Mage_Core_Block_Template |
| 22 | 22 | { |
| 23 | 23 | // Name of the input field |
| 24 | - const SUGGESTION_INPUT_NAME = 'validation_option'; |
|
| 24 | + const SUGGESTION_INPUT_NAME = 'validation_option'; |
|
| 25 | 25 | /** |
| 26 | 26 | * Where to find the format template in the config registry |
| 27 | 27 | * @see EbayEnterprise_Address_Model_Config::$_configPaths |
@@ -917,8 +917,8 @@ discard block |
||
| 917 | 917 | ->method('getAddressType') |
| 918 | 918 | ->will($this->returnValue($addressType)); |
| 919 | 919 | $addressData = [ |
| 920 | - ['street', null, '123 Main St'], |
|
| 921 | - ['city', null, 'Fooville'], |
|
| 920 | + ['street', null, '123 Main St'], |
|
| 921 | + ['city', null, 'Fooville'], |
|
| 922 | 922 | ['region_id', null, 51], |
| 923 | 923 | ]; |
| 924 | 924 | $address->expects($this->any()) |
@@ -967,8 +967,8 @@ discard block |
||
| 967 | 967 | // any one of these being different from the validatedAddressData below |
| 968 | 968 | // will cause the comparison check fail |
| 969 | 969 | $addressData = [ |
| 970 | - ['street', null, 'Borg'], |
|
| 971 | - ['city', null, 'Barton'], |
|
| 970 | + ['street', null, 'Borg'], |
|
| 971 | + ['city', null, 'Barton'], |
|
| 972 | 972 | ['region_id', null, 41], |
| 973 | 973 | ]; |
| 974 | 974 | $address->expects($this->any()) |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | ->will($this->returnValue(array_map( |
| 85 | 85 | // Get just the "store" key from each triple in the $stores array - produces |
| 86 | 86 | // an array of Mage_Core_Model_Store objects. |
| 87 | - function ($storeAndConfig) { |
|
| 87 | + function($storeAndConfig) { |
|
| 88 | 88 | return $storeAndConfig['store']; |
| 89 | 89 | }, |
| 90 | 90 | $stores |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | // and the Eb2cCore module's config as the second for each triple in |
| 100 | 100 | // the $stores array - allows the stub to return the correct |
| 101 | 101 | // configuration for a given store. |
| 102 | - function ($storeAndConfig) { |
|
| 102 | + function($storeAndConfig) { |
|
| 103 | 103 | return array($storeAndConfig['store'], $storeAndConfig['core_config']); |
| 104 | 104 | }, |
| 105 | 105 | $stores |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | // and the EbayEnterprise_Amqp module's config as the second for each |
| 114 | 114 | // triple in the $stores array - allows the stub to return the correct |
| 115 | 115 | // configuration for a given store. |
| 116 | - function ($storeAndConfig) { |
|
| 116 | + function($storeAndConfig) { |
|
| 117 | 117 | return array($storeAndConfig['store'], $storeAndConfig['amqp_config']); |
| 118 | 118 | }, |
| 119 | 119 | $stores |
@@ -370,8 +370,8 @@ discard block |
||
| 370 | 370 | */ |
| 371 | 371 | public function mapPattern(array $keyMap, $pattern) |
| 372 | 372 | { |
| 373 | - return array_reduce(array_keys($keyMap), function ($result, $key) use ($keyMap, $pattern) { |
|
| 374 | - $result = (trim($result) === '')? $pattern : $result; |
|
| 373 | + return array_reduce(array_keys($keyMap), function($result, $key) use ($keyMap, $pattern) { |
|
| 374 | + $result = (trim($result) === '') ? $pattern : $result; |
|
| 375 | 375 | return str_replace(sprintf('{%s}', $key), $keyMap[$key], $result); |
| 376 | 376 | }); |
| 377 | 377 | } |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | protected function _loadWebsiteFilter($mageStoreId) |
| 548 | 548 | { |
| 549 | 549 | $config = Mage::helper('eb2ccore')->getConfigModel($mageStoreId); |
| 550 | - return array ( |
|
| 550 | + return array( |
|
| 551 | 551 | 'catalog_id' => $config->catalogId, |
| 552 | 552 | 'client_id' => $config->clientId, |
| 553 | 553 | 'store_id' => $config->storeId, |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | */ |
| 642 | 642 | public function denormalizeSku($itemId, $catalogId) |
| 643 | 643 | { |
| 644 | - return (!empty($itemId) && strpos($itemId, $catalogId . '-') === 0)? |
|
| 644 | + return (!empty($itemId) && strpos($itemId, $catalogId . '-') === 0) ? |
|
| 645 | 645 | str_replace($catalogId . '-', '', $itemId) : $itemId; |
| 646 | 646 | } |
| 647 | 647 | |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | * @param mixed |
| 720 | 720 | * @return mixed |
| 721 | 721 | */ |
| 722 | - protected function reregister($key, $value=null) |
|
| 722 | + protected function reregister($key, $value = null) |
|
| 723 | 723 | { |
| 724 | 724 | $old = Mage::registry($key); |
| 725 | 725 | Mage::unregister($key); |
@@ -165,8 +165,7 @@ discard block |
||
| 165 | 165 | // (dates prior to unix epoch time 0 for example). If the two combined |
| 166 | 166 | // functions are unable to produce a valid time, fall back to the unix |
| 167 | 167 | // time `0` so something can be returned. |
| 168 | - return DateTime::createFromFormat('U', strtotime($messageDateTime)) ?: |
|
| 169 | - DateTime::createFromFormat('U', 0); |
|
| 168 | + return DateTime::createFromFormat('U', strtotime($messageDateTime)) ?: DateTime::createFromFormat('U', 0); |
|
| 170 | 169 | } |
| 171 | 170 | /** |
| 172 | 171 | * Ensure the Feed's event type matches. |
@@ -224,7 +223,7 @@ discard block |
||
| 224 | 223 | { |
| 225 | 224 | $data = array(); |
| 226 | 225 | foreach ($mhc as $key => $value) { |
| 227 | - $data[$key] = (is_array($value))? Mage::helper('eb2ccore')->invokeCallback($value) : $value; |
|
| 226 | + $data[$key] = (is_array($value)) ? Mage::helper('eb2ccore')->invokeCallback($value) : $value; |
|
| 228 | 227 | } |
| 229 | 228 | return $data; |
| 230 | 229 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function passSubClass($attrValue, $attribute, Mage_Catalog_Model_Product $product, DOMDocument $doc) |
| 118 | 118 | { |
| 119 | - $value = (int)0; |
|
| 119 | + $value = (int) 0; |
|
| 120 | 120 | if (!empty($attrValue)) { |
| 121 | 121 | $value = $attrValue; |
| 122 | 122 | } |
@@ -287,8 +287,7 @@ discard block |
||
| 287 | 287 | */ |
| 288 | 288 | public function passSalesClass($attrValue, $attribute, Mage_Catalog_Model_Product $product, DOMDocument $doc) |
| 289 | 289 | { |
| 290 | - $enum = empty($attrValue) ? 'stock' : |
|
| 291 | - Mage::getSingleton('eav/entity_attribute') |
|
| 290 | + $enum = empty($attrValue) ? 'stock' : Mage::getSingleton('eav/entity_attribute') |
|
| 292 | 291 | ->loadByCode($product::ENTITY, $attribute) |
| 293 | 292 | ->getSource()->getOptionText($attrValue); |
| 294 | 293 | return $this->passString($enum, $attribute, $product, $doc); |
@@ -99,9 +99,8 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function extractStatusValue(DOMNodeList $nodes) |
| 101 | 101 | { |
| 102 | - return ($nodes->length && strtolower($nodes->item(0)->nodeValue) === 'active')? |
|
| 103 | - Mage_Catalog_Model_Product_Status::STATUS_ENABLED: |
|
| 104 | - Mage_Catalog_Model_Product_Status::STATUS_DISABLED; |
|
| 102 | + return ($nodes->length && strtolower($nodes->item(0)->nodeValue) === 'active') ? |
|
| 103 | + Mage_Catalog_Model_Product_Status::STATUS_ENABLED : Mage_Catalog_Model_Product_Status::STATUS_DISABLED; |
|
| 105 | 104 | } |
| 106 | 105 | /** |
| 107 | 106 | * extracts visibility from node list, returning an expected integer or translating an expected string |
@@ -142,7 +141,7 @@ discard block |
||
| 142 | 141 | public function extractProductTypeValue(DOMNodeList $nodes, Mage_Catalog_Model_Product $product) |
| 143 | 142 | { |
| 144 | 143 | $value = strtolower($this->coreHelper->extractNodeVal($nodes)); |
| 145 | - $type = ($this->_isValidProductType($value))? $value : Mage_Catalog_Model_Product_Type::TYPE_SIMPLE; |
|
| 144 | + $type = ($this->_isValidProductType($value)) ? $value : Mage_Catalog_Model_Product_Type::TYPE_SIMPLE; |
|
| 146 | 145 | $product->setTypeId($type) |
| 147 | 146 | ->setTypeInstance(Mage_Catalog_Model_Product_Type::factory($product, true), true); |
| 148 | 147 | return $type; |
@@ -232,9 +231,8 @@ discard block |
||
| 232 | 231 | public function extractUrlKeyValue(DOMNodeList $nodes, Mage_Catalog_Model_Product $product) |
| 233 | 232 | { |
| 234 | 233 | $urlKey = $this->coreHelper->extractNodeVal($nodes); |
| 235 | - return ($urlKey !== '')? |
|
| 236 | - $urlKey . '-' . $product->getStoreId() : |
|
| 237 | - 'Incomplete Product: ' . $product->getSku() . '-' . $product->getStoreId(); |
|
| 234 | + return ($urlKey !== '') ? |
|
| 235 | + $urlKey . '-' . $product->getStoreId() : 'Incomplete Product: ' . $product->getSku() . '-' . $product->getStoreId(); |
|
| 238 | 236 | } |
| 239 | 237 | /** |
| 240 | 238 | * given a gift card type return the gift card constant mapped to it |
@@ -264,7 +262,7 @@ discard block |
||
| 264 | 262 | $value = $this->coreHelper->extractNodeVal($nodes); |
| 265 | 263 | $cfg = Mage::helper('ebayenterprise_catalog')->getConfigModel(); |
| 266 | 264 | $mapData = $cfg->getConfigData(EbayEnterprise_Catalog_Helper_Feed::GIFTCARD_TENDER_CONFIG_PATH); |
| 267 | - return isset($mapData[$value])? $this->_getGiftCardType($mapData[$value]) : null; |
|
| 265 | + return isset($mapData[$value]) ? $this->_getGiftCardType($mapData[$value]) : null; |
|
| 268 | 266 | } |
| 269 | 267 | |
| 270 | 268 | /** |
@@ -313,7 +311,7 @@ discard block |
||
| 313 | 311 | */ |
| 314 | 312 | public function extractStringValue(DOMNodeList $nodes) |
| 315 | 313 | { |
| 316 | - return ($nodes->length)? $nodes->item(0)->nodeValue : null; |
|
| 314 | + return ($nodes->length) ? $nodes->item(0)->nodeValue : null; |
|
| 317 | 315 | } |
| 318 | 316 | /** |
| 319 | 317 | * extract the first element of a dom node list and return a boolean |
@@ -323,7 +321,7 @@ discard block |
||
| 323 | 321 | */ |
| 324 | 322 | public function extractBoolValue(DOMNodeList $nodes) |
| 325 | 323 | { |
| 326 | - return $this->coreHelper->parseBool(($nodes->length)? $nodes->item(0)->nodeValue : null); |
|
| 324 | + return $this->coreHelper->parseBool(($nodes->length) ? $nodes->item(0)->nodeValue : null); |
|
| 327 | 325 | } |
| 328 | 326 | /** |
| 329 | 327 | * extract the first element of a dom node list and return the string value cast as integer value |
@@ -332,7 +330,7 @@ discard block |
||
| 332 | 330 | */ |
| 333 | 331 | public function extractIntValue(DOMNodeList $nodes) |
| 334 | 332 | { |
| 335 | - return ($nodes->length)? (int) $nodes->item(0)->nodeValue : 0; |
|
| 333 | + return ($nodes->length) ? (int) $nodes->item(0)->nodeValue : 0; |
|
| 336 | 334 | } |
| 337 | 335 | /** |
| 338 | 336 | * extract the first element of a dom node list and return the string value cast as float value |
@@ -341,7 +339,7 @@ discard block |
||
| 341 | 339 | */ |
| 342 | 340 | public function extractFloatValue(DOMNodeList $nodes) |
| 343 | 341 | { |
| 344 | - return ($nodes->length)? (float) $nodes->item(0)->nodeValue : 0; |
|
| 342 | + return ($nodes->length) ? (float) $nodes->item(0)->nodeValue : 0; |
|
| 345 | 343 | } |
| 346 | 344 | /** |
| 347 | 345 | * it return the pass in value parameter |
@@ -425,7 +423,7 @@ discard block |
||
| 425 | 423 | $product->setUseConfigGiftMessageAvailable(0); |
| 426 | 424 | // Explicitly casting the extracted boolean value as an integer value because |
| 427 | 425 | // Magento only work with integer value 0 or 1 representing boolean value in the database. |
| 428 | - return (int) $this->coreHelper->parseBool(($nodes->length)? $nodes->item(0)->nodeValue : null); |
|
| 426 | + return (int) $this->coreHelper->parseBool(($nodes->length) ? $nodes->item(0)->nodeValue : null); |
|
| 429 | 427 | } |
| 430 | 428 | return null; |
| 431 | 429 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | protected function _getAttributeIdByName($name) |
| 66 | 66 | { |
| 67 | 67 | $attribute = $this->_getAttributeCollection()->getItemByColumnValue('attribute_code', $name); |
| 68 | - return ($attribute)? $attribute->getId() : null; |
|
| 68 | + return ($attribute) ? $attribute->getId() : null; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | { |
| 141 | 141 | /** @var Mage_Eav_Model_Entity_Attribute_Option */ |
| 142 | 142 | $option = $this->_getAttributeOptionModel($attributeCode, $optionValue); |
| 143 | - return (!is_null($option))? (int) $option->getOptionId() : 0; |
|
| 143 | + return (!is_null($option)) ? (int) $option->getOptionId() : 0; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | return array_filter( |
| 74 | 74 | array_map(array($this, '_mapNamePathToId'), $this->_convertNodesToDashNames($nodes)), |
| 75 | - function ($id) { |
|
| 75 | + function($id) { |
|
| 76 | 76 | // Strip elements where the path was not found. |
| 77 | 77 | // @see _mapNamePathToId |
| 78 | 78 | return $id !== -1; |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $ids = array_reverse($catColl->getAllIds()); |
| 116 | 116 | $names = array_reverse($catColl->getColumnValues('name')); |
| 117 | 117 | $this->_namePathToIdMap = array_combine( |
| 118 | - array_map(function ($path) use ($ids, $names) { |
|
| 118 | + array_map(function($path) use ($ids, $names) { |
|
| 119 | 119 | // replace each id in a path with the category name for that |
| 120 | 120 | // category id, and replace slashes with dashes. |
| 121 | 121 | return strtr(str_replace($ids, $names, $path), '/', '-'); |