1111use Magento \Framework \View ;
1212use Magento \Framework \Escaper ;
1313use Magento \Framework \App \ObjectManager ;
14+ use Magento \Store \Model \ScopeInterface ;
1415
1516/**
1617 * An API for page configuration
@@ -33,29 +34,29 @@ class Config
3334 /**#@+
3435 * Constants of available types
3536 */
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 ' ;
3940 /**#@-*/
4041
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 ' ;
4950
5051 /**
5152 * Constant body attribute class
5253 */
53- const BODY_ATTRIBUTE_CLASS = 'class ' ;
54+ public const BODY_ATTRIBUTE_CLASS = 'class ' ;
5455
5556 /**
5657 * Constant html language attribute
5758 */
58- const HTML_ATTRIBUTE_LANG = 'lang ' ;
59+ public const HTML_ATTRIBUTE_LANG = 'lang ' ;
5960
6061 /**
6162 * @var Escaper
@@ -321,7 +322,7 @@ public function getMediaType()
321322 if (empty ($ this ->metadata [self ::META_MEDIA_TYPE ])) {
322323 $ this ->metadata [self ::META_MEDIA_TYPE ] = $ this ->scopeConfig ->getValue (
323324 'design/head/default_media_type ' ,
324- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
325+ ScopeInterface::SCOPE_STORE
325326 );
326327 }
327328 return $ this ->metadata [self ::META_MEDIA_TYPE ];
@@ -349,7 +350,7 @@ public function getCharset()
349350 if (empty ($ this ->metadata [self ::META_CHARSET ])) {
350351 $ this ->metadata [self ::META_CHARSET ] = $ this ->scopeConfig ->getValue (
351352 'design/head/default_charset ' ,
352- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
353+ ScopeInterface::SCOPE_STORE
353354 );
354355 }
355356 return $ this ->metadata [self ::META_CHARSET ];
@@ -377,7 +378,7 @@ public function getDescription()
377378 if (empty ($ this ->metadata [self ::META_DESCRIPTION ])) {
378379 $ this ->metadata [self ::META_DESCRIPTION ] = $ this ->scopeConfig ->getValue (
379380 'design/head/default_description ' ,
380- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
381+ ScopeInterface::SCOPE_STORE
381382 );
382383 }
383384 return $ this ->metadata [self ::META_DESCRIPTION ];
@@ -432,7 +433,7 @@ public function getKeywords()
432433 if (empty ($ this ->metadata [self ::META_KEYWORDS ])) {
433434 $ this ->metadata [self ::META_KEYWORDS ] = $ this ->scopeConfig ->getValue (
434435 'design/head/default_keywords ' ,
435- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
436+ ScopeInterface::SCOPE_STORE
436437 );
437438 }
438439 return $ this ->metadata [self ::META_KEYWORDS ];
@@ -464,7 +465,7 @@ public function getRobots()
464465 if (empty ($ this ->metadata [self ::META_ROBOTS ])) {
465466 $ this ->metadata [self ::META_ROBOTS ] = $ this ->scopeConfig ->getValue (
466467 'design/search_engine_robots/default_robots ' ,
467- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE
468+ ScopeInterface::SCOPE_STORE
468469 );
469470 }
470471 return $ this ->metadata [self ::META_ROBOTS ];
@@ -651,12 +652,8 @@ public function getDefaultFavicon()
651652 */
652653 public function getIncludes ()
653654 {
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 ;
661658 }
662659}
0 commit comments