File tree Expand file tree Collapse file tree 7 files changed +11
-9
lines changed
CatalogRuleSampleData/Model
ConfigurableSampleData/Model/Product Expand file tree Collapse file tree 7 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ public function convertSerializedData($data)
128128 preg_match_all ($ regexp , $ data , $ matches );
129129 $ replacement = null ;
130130 foreach ($ matches [1 ] as $ matchedId => $ matchedItem ) {
131- $ extractedData = array_filter (explode (", " , $ matchedItem ));
131+ $ extractedData = array_filter (explode (", " , $ matchedItem ?? '' ));
132132 foreach ($ extractedData as $ extractedItem ) {
133133 $ separatedData = array_filter (explode ('= ' , $ extractedItem ));
134134 if ($ separatedData [0 ] == 'url_key ' ) {
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ public function install(array $fixtures)
108108 foreach ($ rows as $ row ) {
109109 $ data = [];
110110 foreach ($ row as $ key => $ value ) {
111- $ data [$ header [$ key ]] = trim ($ value );
111+ $ data [$ header [$ key ]] = trim ($ value ?? '' );
112112 }
113113 $ data ['attribute_set ' ] = explode ("\n" , $ data ['attribute_set ' ]);
114114
@@ -144,7 +144,7 @@ public function install(array $fixtures)
144144
145145 if (is_array ($ data ['attribute_set ' ])) {
146146 foreach ($ data ['attribute_set ' ] as $ setName ) {
147- $ setName = trim ($ setName );
147+ $ setName = trim ($ setName ?? '' );
148148 $ attributeCount ++;
149149 $ attributeSet = $ this ->processAttributeSet ($ setName );
150150 $ attributeGroupId = $ attributeSet ->getDefaultGroupId ();
@@ -171,7 +171,7 @@ public function install(array $fixtures)
171171 protected function getOption ($ attribute , $ data )
172172 {
173173 $ result = [];
174- $ data ['option ' ] = explode ("\n" , $ data ['option ' ]);
174+ $ data ['option ' ] = explode ("\n" , $ data ['option ' ] ?? '' );
175175 /** @var \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection $options */
176176 $ options = $ this ->attrOptionCollectionFactory ->create ()
177177 ->setAttributeFilter ($ attribute ->getId ())
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ protected function getArrayValue($value)
165165 if (is_array ($ value )) {
166166 return $ value ;
167167 }
168- if (false !== strpos ($ value , "\n" )) {
168+ if ($ value !== null && false !== strpos ($ value , "\n" )) {
169169 $ value = array_filter (explode ("\n" , $ value ));
170170 }
171171 return !is_array ($ value ) ? [$ value ] : $ value ;
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ protected function convertAttributeValues($valuesData)
139139 $ values = [];
140140 $ prices = [];
141141 foreach ($ valuesData as $ item ) {
142- $ itemData = explode ('; ' , $ item );
142+ $ itemData = explode ('; ' , $ item ?? '' );
143143 if (!empty ($ itemData [0 ])) {
144144 $ values [] = $ itemData [0 ];
145145 }
Original file line number Diff line number Diff line change @@ -126,7 +126,8 @@ private function getOptionSwatchVisual(array $attributeData)
126126 {
127127 $ optionSwatch = ['value ' => []];
128128 foreach ($ attributeData ['option ' ] as $ optionKey => $ optionValue ) {
129- if (substr ($ optionValue , 0 , 1 ) == '# ' && strlen ($ optionValue ) == 7 ) {
129+ if ($ optionValue !== null && substr ($ optionValue , 0 , 1 ) == '# '
130+ && strlen ($ optionValue ) == 7 ) {
130131 $ optionSwatch ['value ' ][$ optionKey ] = $ optionValue ;
131132 } else if (!empty ($ this ->colorMap [$ optionValue ])) {
132133 $ optionSwatch ['value ' ][$ optionKey ] = $ this ->colorMap [$ optionValue ];
Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ public function __construct(
5757
5858 public function add ($ contentFile , $ cssFile )
5959 {
60- $ styleContent = preg_replace ('/^\/\*[\s\S]+\*\// ' , '' , file_get_contents ($ contentFile ));
60+ $ styleContent = preg_replace ('/^\/\*[\s\S]+\*\// ' , '' ,
61+ file_get_contents ($ contentFile ?? '' ));
6162 if (empty ($ styleContent )) {
6263 return ;
6364 }
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ public function install(array $fixtures)
8080 if (!$ wishlist ->getId ()) {
8181 continue ;
8282 }
83- $ productSkuList = explode ("\n" , $ row ['product_list ' ]);
83+ $ productSkuList = explode ("\n" , $ row ['product_list ' ] ?? '' );
8484 $ this ->helper ->addProductsToWishlist ($ wishlist , $ productSkuList );
8585 }
8686 }
You can’t perform that action at this time.
0 commit comments