11
11
use Magento \Framework \View ;
12
12
use Magento \Framework \Escaper ;
13
13
use Magento \Framework \App \ObjectManager ;
14
+ use Magento \Store \Model \ScopeInterface ;
14
15
15
16
/**
16
17
* An API for page configuration
@@ -33,29 +34,29 @@ class Config
33
34
/**#@+
34
35
* Constants of available types
35
36
*/
36
- const ELEMENT_TYPE_BODY = 'body ' ;
37
- const ELEMENT_TYPE_HTML = 'html ' ;
38
- const ELEMENT_TYPE_HEAD = 'head ' ;
37
+ public const ELEMENT_TYPE_BODY = 'body ' ;
38
+ public const ELEMENT_TYPE_HTML = 'html ' ;
39
+ public const ELEMENT_TYPE_HEAD = 'head ' ;
39
40
/**#@-*/
40
41
41
- const META_DESCRIPTION = 'description ' ;
42
- const META_CONTENT_TYPE = 'content_type ' ;
43
- const META_MEDIA_TYPE = 'media_type ' ;
44
- const META_CHARSET = 'charset ' ;
45
- const META_TITLE = 'title ' ;
46
- const META_KEYWORDS = 'keywords ' ;
47
- const META_ROBOTS = 'robots ' ;
48
- const META_X_UI_COMPATIBLE = 'x_ua_compatible ' ;
42
+ public const META_DESCRIPTION = 'description ' ;
43
+ public const META_CONTENT_TYPE = 'content_type ' ;
44
+ public const META_MEDIA_TYPE = 'media_type ' ;
45
+ public const META_CHARSET = 'charset ' ;
46
+ public const META_TITLE = 'title ' ;
47
+ public const META_KEYWORDS = 'keywords ' ;
48
+ public const META_ROBOTS = 'robots ' ;
49
+ public const META_X_UI_COMPATIBLE = 'x_ua_compatible ' ;
49
50
50
51
/**
51
52
* Constant body attribute class
52
53
*/
53
- const BODY_ATTRIBUTE_CLASS = 'class ' ;
54
+ public const BODY_ATTRIBUTE_CLASS = 'class ' ;
54
55
55
56
/**
56
57
* Constant html language attribute
57
58
*/
58
- const HTML_ATTRIBUTE_LANG = 'lang ' ;
59
+ public const HTML_ATTRIBUTE_LANG = 'lang ' ;
59
60
60
61
/**
61
62
* @var Escaper
@@ -321,7 +322,7 @@ public function getMediaType()
321
322
if (empty ($ this ->metadata [self ::META_MEDIA_TYPE ])) {
322
323
$ this ->metadata [self ::META_MEDIA_TYPE ] = $ this ->scopeConfig ->getValue (
323
324
'design/head/default_media_type ' ,
324
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
325
+ ScopeInterface::SCOPE_STORE
325
326
);
326
327
}
327
328
return $ this ->metadata [self ::META_MEDIA_TYPE ];
@@ -349,7 +350,7 @@ public function getCharset()
349
350
if (empty ($ this ->metadata [self ::META_CHARSET ])) {
350
351
$ this ->metadata [self ::META_CHARSET ] = $ this ->scopeConfig ->getValue (
351
352
'design/head/default_charset ' ,
352
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
353
+ ScopeInterface::SCOPE_STORE
353
354
);
354
355
}
355
356
return $ this ->metadata [self ::META_CHARSET ];
@@ -377,7 +378,7 @@ public function getDescription()
377
378
if (empty ($ this ->metadata [self ::META_DESCRIPTION ])) {
378
379
$ this ->metadata [self ::META_DESCRIPTION ] = $ this ->scopeConfig ->getValue (
379
380
'design/head/default_description ' ,
380
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
381
+ ScopeInterface::SCOPE_STORE
381
382
);
382
383
}
383
384
return $ this ->metadata [self ::META_DESCRIPTION ];
@@ -432,7 +433,7 @@ public function getKeywords()
432
433
if (empty ($ this ->metadata [self ::META_KEYWORDS ])) {
433
434
$ this ->metadata [self ::META_KEYWORDS ] = $ this ->scopeConfig ->getValue (
434
435
'design/head/default_keywords ' ,
435
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
436
+ ScopeInterface::SCOPE_STORE
436
437
);
437
438
}
438
439
return $ this ->metadata [self ::META_KEYWORDS ];
@@ -464,7 +465,7 @@ public function getRobots()
464
465
if (empty ($ this ->metadata [self ::META_ROBOTS ])) {
465
466
$ this ->metadata [self ::META_ROBOTS ] = $ this ->scopeConfig ->getValue (
466
467
'design/search_engine_robots/default_robots ' ,
467
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
468
+ ScopeInterface::SCOPE_STORE
468
469
);
469
470
}
470
471
return $ this ->metadata [self ::META_ROBOTS ];
@@ -651,12 +652,8 @@ public function getDefaultFavicon()
651
652
*/
652
653
public function getIncludes ()
653
654
{
654
- if (empty ($ this ->includes ) && $ this ->isIncludesAvailable ) {
655
- $ this ->includes = $ this ->scopeConfig ->getValue (
656
- 'design/head/includes ' ,
657
- \Magento \Store \Model \ScopeInterface::SCOPE_STORE
658
- );
659
- }
660
- return $ this ->includes ?? '' ;
655
+ $ this ->includes = ($ this ->isIncludesAvailable && $ this ->includes === null ) ?
656
+ $ this ->scopeConfig ->getValue ('design/head/includes ' , ScopeInterface::SCOPE_STORE ) : '' ;
657
+ return $ this ->includes ;
661
658
}
662
659
}
0 commit comments