File tree Expand file tree Collapse file tree 3 files changed +28
-27
lines changed Expand file tree Collapse file tree 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)
9393 if ($ hasVariable ) {
9494 $ message .= ' Variables inside are insecure. ' ;
9595 }
96- $ phpcsFile ->addWarning (
96+ $ phpcsFile ->addError (
9797 $ message ,
9898 $ stackPtr ,
9999 $ this ->warningCode ,
Original file line number Diff line number Diff line change 33 * Copyright © Magento. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6+
67namespace Magento \Tests \Security ;
78
89use PHP_CodeSniffer \Tests \Standards \AbstractSniffUnitTest ;
@@ -16,14 +17,6 @@ class IncludeFileUnitTest extends AbstractSniffUnitTest
1617 * @inheritdoc
1718 */
1819 public function getErrorList ()
19- {
20- return [];
21- }
22-
23- /**
24- * @inheritdoc
25- */
26- public function getWarningList ()
2720 {
2821 return [
2922 3 => 1 ,
@@ -42,4 +35,12 @@ public function getWarningList()
4235 34 => 1 ,
4336 ];
4437 }
38+
39+ /**
40+ * @inheritdoc
41+ */
42+ public function getWarningList ()
43+ {
44+ return [];
45+ }
4546}
Original file line number Diff line number Diff line change 4747 <severity >10</severity >
4848 <type >error</type >
4949 </rule >
50+ <rule ref =" Magento.Security.IncludeFile" >
51+ <severity >10</severity >
52+ <type >error</type >
53+ </rule >
5054 <rule ref =" Magento.Security.LanguageConstruct" >
5155 <severity >10</severity >
5256 <type >error</type >
7377 <type >error</type >
7478 </rule >
7579
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" >
7890 <severity >9</severity >
7991 <type >warning</type >
8092 </rule >
8799 <severity >9</severity >
88100 <type >warning</type >
89101 </rule >
102+ <rule ref =" Squiz.PHP.NonExecutableCode" >
103+ <severity >9</severity >
104+ <type >warning</type >
105+ </rule >
90106
91107 <!-- Severity 8 warnings: Magento specific code issues. -->
92108 <rule ref =" Magento.Classes.ObjectInstantiation" >
113129 <severity >8</severity >
114130 <type >warning</type >
115131 </rule >
116- <rule ref =" Magento.PHP.DateTime" >
117- <severity >8</severity >
118- <type >warning</type >
119- </rule >
120132 <rule ref =" Magento.PHP.ShortEchoSyntax" >
121133 <severity >8</severity >
122134 <type >warning</type >
183195 <severity >7</severity >
184196 <type >warning</type >
185197 </rule >
186- <rule ref =" Magento.PHP.DiscouragedFunction" >
187- <severity >7</severity >
188- <type >warning</type >
189- </rule >
190198 <rule ref =" Magento.PHP.LiteralNamespaces" >
191199 <severity >7</severity >
192200 <type >warning</type >
219227 <severity >7</severity >
220228 <type >warning</type >
221229 </rule >
222- <rule ref =" Squiz.PHP.NonExecutableCode" >
223- <severity >7</severity >
224- <type >warning</type >
225- </rule >
226230 <rule ref =" Squiz.Scope.MemberVarScope" >
227231 <severity >7</severity >
228232 <type >warning</type >
233237 <severity >6</severity >
234238 <type >warning</type >
235239 </rule >
236- <rule ref =" Generic.Files.ByteOrderMark" >
237- <severity >6</severity >
238- <type >warning</type >
239- </rule >
240240 <rule ref =" Generic.Files.LineEndings" >
241241 <severity >6</severity >
242242 <type >warning</type >
You can’t perform that action at this time.
0 commit comments