@@ -86,7 +86,7 @@ class Filesystem implements \Magento\Framework\Config\ReaderInterface
86
86
*
87
87
* @var string
88
88
*/
89
- protected $ _typeAttributeName ;
89
+ private $ typeAttributeName ;
90
90
91
91
/**
92
92
* Constructor
@@ -110,7 +110,7 @@ public function __construct(
110
110
$ idAttributes = [],
111
111
$ domDocumentClass = \Magento \Framework \Config \Dom::class,
112
112
$ defaultScope = 'global ' ,
113
- $ typeAttributeName = null ,
113
+ ? string $ typeAttributeName = null ,
114
114
) {
115
115
$ this ->_fileResolver = $ fileResolver ;
116
116
$ this ->_converter = $ converter ;
@@ -122,7 +122,7 @@ public function __construct(
122
122
? $ schemaLocator ->getPerFileSchema () : null ;
123
123
$ this ->_domDocumentClass = $ domDocumentClass ;
124
124
$ this ->_defaultScope = $ defaultScope ;
125
- $ this ->_typeAttributeName = $ typeAttributeName ;
125
+ $ this ->typeAttributeName = $ typeAttributeName ;
126
126
}
127
127
128
128
/**
@@ -158,9 +158,6 @@ protected function _readFiles($fileList)
158
158
foreach ($ fileList as $ key => $ content ) {
159
159
try {
160
160
if (!$ configMerger ) {
161
- if ($ this ->isDbSchemaFile ($ key )) {
162
- $ this ->_typeAttributeName = 'xsi:type ' ;
163
- }
164
161
$ configMerger = $ this ->_createConfigMerger ($ this ->_domDocumentClass , $ content );
165
162
} else {
166
163
$ configMerger ->merge ($ content );
@@ -184,9 +181,6 @@ protected function _readFiles($fileList)
184
181
$ configMerger = null ;
185
182
foreach ($ fileList as $ key => $ content ) {
186
183
if (!$ configMerger ) {
187
- if ($ this ->isDbSchemaFile ($ key )) {
188
- $ this ->_typeAttributeName = 'xsi:type ' ;
189
- }
190
184
$ configMerger = $ this ->_createConfigMerger ($ this ->_domDocumentClass , $ content );
191
185
} else {
192
186
$ configMerger ->merge ($ content );
@@ -226,7 +220,7 @@ protected function _createConfigMerger($mergerClass, $initialContents)
226
220
$ initialContents ,
227
221
$ this ->validationState ,
228
222
$ this ->_idAttributes ,
229
- $ this ->_typeAttributeName ,
223
+ $ this ->typeAttributeName ,
230
224
$ this ->_perFileSchema
231
225
);
232
226
if (!$ result instanceof \Magento \Framework \Config \Dom) {
@@ -236,17 +230,4 @@ protected function _createConfigMerger($mergerClass, $initialContents)
236
230
}
237
231
return $ result ;
238
232
}
239
-
240
- /**
241
- * Check schema file, return true if it is db_schema.xml
242
- *
243
- * @param string $filePath
244
- * @return bool
245
- */
246
- private function isDbSchemaFile (string $ filePath ): bool
247
- {
248
- // Check only if "db_schema.xml" is at the very end of the path
249
- $ pattern = '/db_schema\.xml$/ ' ;
250
- return preg_match ($ pattern , $ filePath ) === 1 ;
251
- }
252
233
}
0 commit comments