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)
128
128
preg_match_all ($ regexp , $ data , $ matches );
129
129
$ replacement = null ;
130
130
foreach ($ matches [1 ] as $ matchedId => $ matchedItem ) {
131
- $ extractedData = array_filter (explode (", " , $ matchedItem ));
131
+ $ extractedData = array_filter (explode (", " , $ matchedItem ?? '' ));
132
132
foreach ($ extractedData as $ extractedItem ) {
133
133
$ separatedData = array_filter (explode ('= ' , $ extractedItem ));
134
134
if ($ separatedData [0 ] == 'url_key ' ) {
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ public function install(array $fixtures)
108
108
foreach ($ rows as $ row ) {
109
109
$ data = [];
110
110
foreach ($ row as $ key => $ value ) {
111
- $ data [$ header [$ key ]] = trim ($ value );
111
+ $ data [$ header [$ key ]] = trim ($ value ?? '' );
112
112
}
113
113
$ data ['attribute_set ' ] = explode ("\n" , $ data ['attribute_set ' ]);
114
114
@@ -144,7 +144,7 @@ public function install(array $fixtures)
144
144
145
145
if (is_array ($ data ['attribute_set ' ])) {
146
146
foreach ($ data ['attribute_set ' ] as $ setName ) {
147
- $ setName = trim ($ setName );
147
+ $ setName = trim ($ setName ?? '' );
148
148
$ attributeCount ++;
149
149
$ attributeSet = $ this ->processAttributeSet ($ setName );
150
150
$ attributeGroupId = $ attributeSet ->getDefaultGroupId ();
@@ -171,7 +171,7 @@ public function install(array $fixtures)
171
171
protected function getOption ($ attribute , $ data )
172
172
{
173
173
$ result = [];
174
- $ data ['option ' ] = explode ("\n" , $ data ['option ' ]);
174
+ $ data ['option ' ] = explode ("\n" , $ data ['option ' ] ?? '' );
175
175
/** @var \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection $options */
176
176
$ options = $ this ->attrOptionCollectionFactory ->create ()
177
177
->setAttributeFilter ($ attribute ->getId ())
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ protected function getArrayValue($value)
165
165
if (is_array ($ value )) {
166
166
return $ value ;
167
167
}
168
- if (false !== strpos ($ value , "\n" )) {
168
+ if ($ value !== null && false !== strpos ($ value , "\n" )) {
169
169
$ value = array_filter (explode ("\n" , $ value ));
170
170
}
171
171
return !is_array ($ value ) ? [$ value ] : $ value ;
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ protected function convertAttributeValues($valuesData)
139
139
$ values = [];
140
140
$ prices = [];
141
141
foreach ($ valuesData as $ item ) {
142
- $ itemData = explode ('; ' , $ item );
142
+ $ itemData = explode ('; ' , $ item ?? '' );
143
143
if (!empty ($ itemData [0 ])) {
144
144
$ values [] = $ itemData [0 ];
145
145
}
Original file line number Diff line number Diff line change @@ -126,7 +126,8 @@ private function getOptionSwatchVisual(array $attributeData)
126
126
{
127
127
$ optionSwatch = ['value ' => []];
128
128
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 ) {
130
131
$ optionSwatch ['value ' ][$ optionKey ] = $ optionValue ;
131
132
} else if (!empty ($ this ->colorMap [$ optionValue ])) {
132
133
$ optionSwatch ['value ' ][$ optionKey ] = $ this ->colorMap [$ optionValue ];
Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ public function __construct(
57
57
58
58
public function add ($ contentFile , $ cssFile )
59
59
{
60
- $ styleContent = preg_replace ('/^\/\*[\s\S]+\*\// ' , '' , file_get_contents ($ contentFile ));
60
+ $ styleContent = preg_replace ('/^\/\*[\s\S]+\*\// ' , '' ,
61
+ file_get_contents ($ contentFile ?? '' ));
61
62
if (empty ($ styleContent )) {
62
63
return ;
63
64
}
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ public function install(array $fixtures)
80
80
if (!$ wishlist ->getId ()) {
81
81
continue ;
82
82
}
83
- $ productSkuList = explode ("\n" , $ row ['product_list ' ]);
83
+ $ productSkuList = explode ("\n" , $ row ['product_list ' ] ?? '' );
84
84
$ this ->helper ->addProductsToWishlist ($ wishlist , $ productSkuList );
85
85
}
86
86
}
You can’t perform that action at this time.
0 commit comments