File tree 3 files changed +28
-27
lines changed
3 files changed +28
-27
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ public function process(File $phpcsFile, $stackPtr)
93
93
if ($ hasVariable ) {
94
94
$ message .= ' Variables inside are insecure. ' ;
95
95
}
96
- $ phpcsFile ->addWarning (
96
+ $ phpcsFile ->addError (
97
97
$ message ,
98
98
$ stackPtr ,
99
99
$ this ->warningCode ,
Original file line number Diff line number Diff line change 3
3
* Copyright © Magento. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
6
7
namespace Magento \Tests \Security ;
7
8
8
9
use PHP_CodeSniffer \Tests \Standards \AbstractSniffUnitTest ;
@@ -16,14 +17,6 @@ class IncludeFileUnitTest extends AbstractSniffUnitTest
16
17
* @inheritdoc
17
18
*/
18
19
public function getErrorList ()
19
- {
20
- return [];
21
- }
22
-
23
- /**
24
- * @inheritdoc
25
- */
26
- public function getWarningList ()
27
20
{
28
21
return [
29
22
3 => 1 ,
@@ -42,4 +35,12 @@ public function getWarningList()
42
35
34 => 1 ,
43
36
];
44
37
}
38
+
39
+ /**
40
+ * @inheritdoc
41
+ */
42
+ public function getWarningList ()
43
+ {
44
+ return [];
45
+ }
45
46
}
Original file line number Diff line number Diff line change 47
47
<severity >10</severity >
48
48
<type >error</type >
49
49
</rule >
50
+ <rule ref =" Magento.Security.IncludeFile" >
51
+ <severity >10</severity >
52
+ <type >error</type >
53
+ </rule >
50
54
<rule ref =" Magento.Security.LanguageConstruct" >
51
55
<severity >10</severity >
52
56
<type >error</type >
73
77
<type >error</type >
74
78
</rule >
75
79
76
- <!-- Severity 9 warnings: Possible security issues. -->
77
- <rule ref =" Magento.Security.IncludeFile" >
80
+ <!-- Severity 9 warnings: Possible security and issues that may cause bugs. -->
81
+ <rule ref =" Generic.Files.ByteOrderMark" >
82
+ <severity >9</severity >
83
+ <type >warning</type >
84
+ </rule >
85
+ <rule ref =" Magento.PHP.DateTime" >
86
+ <severity >9</severity >
87
+ <type >warning</type >
88
+ </rule >
89
+ <rule ref =" Magento.PHP.DiscouragedFunction" >
78
90
<severity >9</severity >
79
91
<type >warning</type >
80
92
</rule >
87
99
<severity >9</severity >
88
100
<type >warning</type >
89
101
</rule >
102
+ <rule ref =" Squiz.PHP.NonExecutableCode" >
103
+ <severity >9</severity >
104
+ <type >warning</type >
105
+ </rule >
90
106
91
107
<!-- Severity 8 warnings: Magento specific code issues. -->
92
108
<rule ref =" Magento.Classes.ObjectInstantiation" >
113
129
<severity >8</severity >
114
130
<type >warning</type >
115
131
</rule >
116
- <rule ref =" Magento.PHP.DateTime" >
117
- <severity >8</severity >
118
- <type >warning</type >
119
- </rule >
120
132
<rule ref =" Magento.PHP.ShortEchoSyntax" >
121
133
<severity >8</severity >
122
134
<type >warning</type >
183
195
<severity >7</severity >
184
196
<type >warning</type >
185
197
</rule >
186
- <rule ref =" Magento.PHP.DiscouragedFunction" >
187
- <severity >7</severity >
188
- <type >warning</type >
189
- </rule >
190
198
<rule ref =" Magento.PHP.LiteralNamespaces" >
191
199
<severity >7</severity >
192
200
<type >warning</type >
219
227
<severity >7</severity >
220
228
<type >warning</type >
221
229
</rule >
222
- <rule ref =" Squiz.PHP.NonExecutableCode" >
223
- <severity >7</severity >
224
- <type >warning</type >
225
- </rule >
226
230
<rule ref =" Squiz.Scope.MemberVarScope" >
227
231
<severity >7</severity >
228
232
<type >warning</type >
233
237
<severity >6</severity >
234
238
<type >warning</type >
235
239
</rule >
236
- <rule ref =" Generic.Files.ByteOrderMark" >
237
- <severity >6</severity >
238
- <type >warning</type >
239
- </rule >
240
240
<rule ref =" Generic.Files.LineEndings" >
241
241
<severity >6</severity >
242
242
<type >warning</type >
You can’t perform that action at this time.
0 commit comments