Skip to content

Commit

Permalink
Feature Smile-SA#3184, phpcs cleaning and minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
vahonc authored and romainruaud committed Apr 18, 2024
1 parent d06b891 commit 93d2385
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ public function getAllOptions()
['label' => __('DESC'), 'value' => 'desc'],
];
}

return $this->_options;
}

/**
* Get a text for option value.
*
* @param string|int $value
* @param string|int $value Option value.
*
* @return string|bool
*/
Expand All @@ -54,6 +55,7 @@ public function getOptionText($value)
return $option['label'];
}
}

return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public function __construct(
/**
* Modify sorting direction before setting the collection in the toolbar.
*
* @param ProductListToolbar $subject
* @param mixed $collection
* @param ProductListToolbar $subject Product list toolbar.
* @param mixed $collection Collection.
*
* @return array
*/
Expand Down
4 changes: 1 addition & 3 deletions src/module-elasticsuite-catalog/Setup/CatalogSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use Magento\Catalog\Api\Data\CategoryInterface;
use Magento\Catalog\Model\Category;
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
use Magento\Eav\Model\Config;
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Framework\Exception\LocalizedException;
Expand Down Expand Up @@ -926,11 +925,10 @@ private function updateCategoryAttributeDefaultValue($eavSetup, $entityTypeId, $
$entitySelect = $connection->select();
$entitySelect->from(
$entityTable,
//[new \Zend_Db_Expr("{$attributeId} as attribute_id"), $linkField, new \Zend_Db_Expr("{$value} as value")]
[
new \Zend_Db_Expr("{$attributeId} as attribute_id"),
$linkField,
new \Zend_Db_Expr((is_string($value) ? "'{$value}'" : $value) . ' as value')
new \Zend_Db_Expr((is_string($value) ? "'{$value}'" : $value) . ' as value'),
]
);

Expand Down

0 comments on commit 93d2385

Please sign in to comment.