File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
lib/internal/Magento/Framework/View/Page/Config Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -349,19 +349,18 @@ protected function getGroupAttributes($group)
349
349
*/
350
350
protected function addDefaultAttributes ($ contentType , $ attributes )
351
351
{
352
- switch ($ contentType ) {
353
- case 'js ' :
354
- $ attributes = ' type="text/javascript" ' . $ attributes ;
355
- break ;
352
+ if ($ contentType === 'js ' ) {
353
+ return ' type="text/javascript" ' . $ attributes ;
354
+ }
356
355
357
- case 'css ' :
358
- $ attributes = ' rel="stylesheet" type="text/css" ' . ($ attributes ?: ' media="all" ' );
359
- break ;
356
+ if ( $ contentType === 'css ' ) {
357
+ return ' rel="stylesheet" type="text/css" ' . ($ attributes ?: ' media="all" ' );
358
+ }
360
359
361
- case $ this ->canTypeBeFont ($ contentType ):
362
- $ attributes = 'rel="preload" as="font" crossorigin="anonymous" ' ;
363
- break ;
360
+ if ($ this ->canTypeBeFont ($ contentType )) {
361
+ return 'rel="preload" as="font" crossorigin="anonymous" ' ;
364
362
}
363
+
365
364
return $ attributes ;
366
365
}
367
366
You can’t perform that action at this time.
0 commit comments