1414/**
1515 * Export EAV entity abstract model
1616 *
17+ * phpcs:disable Magento2.Classes.AbstractApi
1718 * @api
1819 *
1920 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -37,8 +38,6 @@ abstract class AbstractEav extends \Magento\ImportExport\Model\Export\AbstractEn
3738 protected $ attributeTypes = [];
3839
3940 /**
40- * Entity type id.
41- *
4241 * @var int
4342 */
4443 protected $ _entityTypeId ;
@@ -131,6 +130,7 @@ protected function _prepareEntityCollection(AbstractCollection $collection)
131130 * @param AbstractCollection $collection
132131 * @return AbstractCollection
133132 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
133+ * phpcs:disable Generic.Metrics.NestingLevel
134134 */
135135 public function filterEntityCollection (AbstractCollection $ collection )
136136 {
@@ -158,7 +158,7 @@ public function filterEntityCollection(AbstractCollection $collection)
158158 $ attributeCode ,
159159 ['eq ' => $ exportFilter [$ attributeCode ]]
160160 );
161- } else if (is_array ($ exportFilter [$ attributeCode ])) {
161+ } elseif (is_array ($ exportFilter [$ attributeCode ])) {
162162 $ collection ->addAttributeToFilter (
163163 $ attributeCode ,
164164 ['in ' => $ exportFilter [$ attributeCode ]]
@@ -214,6 +214,7 @@ public function filterEntityCollection(AbstractCollection $collection)
214214 }
215215 return $ collection ;
216216 }
217+ // phpcs:enable Generic.Metrics.NestingLevel
217218
218219 /**
219220 * Add not skipped attributes to select
@@ -249,12 +250,13 @@ public function getAttributeOptions(AbstractAttribute $attribute)
249250 foreach ($ attribute ->getSource ()->getAllOptions (false ) as $ option ) {
250251 $ optionValues = is_array ($ option ['value ' ]) ? $ option ['value ' ] : [$ option ];
251252 foreach ($ optionValues as $ innerOption ) {
252- if (strlen ($ innerOption ['value ' ])) {
253+ if (isset ( $ innerOption [ ' value ' ]) && strlen ($ innerOption ['value ' ])) {
253254 // skip ' -- Please Select -- ' option
254255 $ options [$ innerOption ['value ' ]] = $ innerOption [$ index ];
255256 }
256257 }
257258 }
259+ // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock.DetectedCatch
258260 } catch (\Exception $ e ) {
259261 // ignore exceptions connected with source models
260262 }
0 commit comments