@@ -10,11 +10,11 @@ class PhtmlTemplateSniff implements Sniff
10
10
private const WARNING_CODE = 'PhtmlTemplateObsolete ' ;
11
11
12
12
private const OBSOLETE_REGEX_IN_SPECIFIC_PHTML_TEMPLATES = [
13
- '/([" \'])jquery\/ui\1/ ' => 'Please do not use "jquery/ui" library in templates. Use needed jquery ' .
13
+ '/([" \'])jquery\/ui\1/ ' => 'Please do not use "jquery/ui" library in templates. Use needed jquery ' .
14
14
'ui widget instead. ' ,
15
- '/data-mage-init=(?: \'|")(?!\s*{\s*"[^"]+")/ ' => 'Please do not initialize JS component in php. Do ' .
15
+ '/data-mage-init=(?: \'|")(?!\s*{\s*"[^"]+")/ ' => 'Please do not initialize JS component in php. Do ' .
16
16
'it in template. ' ,
17
- '@x-magento-init.>(?!\s*+{\s*"[^"]+"\s*:\s*{\s*"[\w/-]+")@i ' => 'Please do not initialize JS component ' .
17
+ '@x-magento-init.>(?!\s*+{\s*"[^"]+"\s*:\s*{\s*"[\w/-]+")@i ' => 'Please do not initialize JS component ' .
18
18
'in php. Do it in template. ' ,
19
19
];
20
20
@@ -54,6 +54,8 @@ public function process(File $phpcsFile, $stackPtr)
54
54
}
55
55
56
56
/**
57
+ * Check access to protected and private members of Block
58
+ *
57
59
* @param File $phpcsFile
58
60
* @param int $stackPtr
59
61
* @param array $tokens
@@ -76,6 +78,8 @@ private function checkBlockVariable(File $phpcsFile, int $stackPtr, array $token
76
78
}
77
79
78
80
/**
81
+ * Check access to members and methods of Block class through $this
82
+ *
79
83
* @param File $phpcsFile
80
84
* @param int $stackPtr
81
85
* @param array $tokens
@@ -98,6 +102,8 @@ private function checkThisVariable(File $phpcsFile, int $stackPtr, array $tokens
98
102
}
99
103
100
104
/**
105
+ * Check use of "text/javascript" type
106
+ *
101
107
* @param File $phpcsFile
102
108
* @param int $stackPtr
103
109
*/
@@ -115,6 +121,8 @@ private function checkHtml(File $phpcsFile, int $stackPtr): void
115
121
}
116
122
117
123
/**
124
+ * Check of some obsoletes uses in specific files
125
+ *
118
126
* @param File $phpcsFile
119
127
* @param int $stackPtr
120
128
*/
@@ -132,5 +140,4 @@ private function checkHtmlSpecificFiles(File $phpcsFile, int $stackPtr): void
132
140
}
133
141
}
134
142
}
135
-
136
143
}
0 commit comments