File tree Expand file tree Collapse file tree 4 files changed +10
-12
lines changed
lib/internal/Magento/Framework/View Expand file tree Collapse file tree 4 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 15
15
use Magento \Framework \View \Asset \File \NotFoundException ;
16
16
17
17
/**
18
- * This ViewModel will add inline critical css in case dev/css/use_css_critical_path is enabled
18
+ * This ViewModel will add inline critical css in case dev/css/use_css_critical_path is enabled.
19
19
*/
20
20
class CriticalCss implements ArgumentInterface
21
21
{
@@ -30,10 +30,8 @@ class CriticalCss implements ArgumentInterface
30
30
private $ filePath ;
31
31
32
32
/**
33
- * @param Template\Context $context
34
33
* @param Repository $assetRepo
35
34
* @param string $filePath
36
- * @param array $data
37
35
*/
38
36
public function __construct (
39
37
Repository $ assetRepo ,
@@ -54,8 +52,11 @@ public function getCriticalCssData()
54
52
try {
55
53
$ asset = $ this ->assetRepo ->createAsset ($ this ->filePath , ['_secure ' => 'false ' ]);
56
54
$ content = $ asset ->getContent ();
57
- } catch (LocalizedException | NotFoundException $ e ) {
58
- throw new LocalizedException (__ ("Cannot get critical css file data: " , $ e ->getMessage ()));
55
+ } catch (NotFoundException $ e ) {
56
+ throw new LocalizedException (__ (
57
+ 'Cannot get critical css file data: "%1" ' ,
58
+ $ e ->getMessage ()
59
+ ));
59
60
};
60
61
61
62
return $ content ;
Original file line number Diff line number Diff line change 10
10
use Magento \Framework \App \Filesystem \DirectoryList ;
11
11
use Magento \Framework \App \ObjectManager ;
12
12
use Magento \Framework \View \Design \Theme \ThemeProviderInterface ;
13
+ use Magento \Framework \Exception \LocalizedException ;
13
14
14
15
/**
15
16
* A repository service for view assets
@@ -201,9 +202,10 @@ private function getDefaultParameter($name)
201
202
/**
202
203
* Create a file asset that's subject of fallback system
203
204
*
204
- * @param string $fileId
205
+ * @param $fileId
205
206
* @param array $params
206
207
* @return File
208
+ * @throws LocalizedException
207
209
*/
208
210
public function createAsset ($ fileId , array $ params = [])
209
211
{
Original file line number Diff line number Diff line change 67
67
<xs : element name =" script" type =" scriptType" minOccurs =" 0" maxOccurs =" unbounded" />
68
68
<xs : element name =" remove" type =" srcRemoveType" minOccurs =" 0" maxOccurs =" unbounded" />
69
69
<xs : element name =" attribute" type =" headAttributeType" minOccurs =" 0" maxOccurs =" unbounded" />
70
+ <xs : element name =" font" type =" linkType" minOccurs =" 0" maxOccurs =" unbounded" />app/code/Magento/Theme/Block/Html/Header/CriticalCss.php
70
71
</xs : sequence >
71
72
</xs : complexType >
72
73
</xs : schema >
Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ class Head implements Layout\ReaderInterface
35
35
36
36
/**
37
37
* {@inheritdoc}
38
- *
39
- * @return string[]
40
38
*/
41
39
public function getSupportedNodes ()
42
40
{
@@ -66,10 +64,6 @@ protected function addContentTypeByNodeName(Layout\Element $node)
66
64
67
65
/**
68
66
* {@inheritdoc}
69
- *
70
- * @param Layout\Reader\Context $readerContext
71
- * @param Layout\Element $headElement
72
- * @return $this
73
67
*/
74
68
public function interpret (
75
69
Layout \Reader \Context $ readerContext ,
You can’t perform that action at this time.
0 commit comments