File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
Security/Tests/BadFunctions Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ eval ('$var = file_get_contents( \'filename.php \'); ' );
4+ eval ($ string );
5+ eval ("\$var = file_get_contents( $ filename );');
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Unit test class for the NoEvals sniff.
4+ */
5+
6+ namespace PHPCS_SecurityAudit \Security \Tests \BadFunctions ;
7+
8+ use PHPCS_SecurityAudit \Security \Tests \AbstractSecurityTestCase ;
9+
10+ class NoEvalsUnitTest extends AbstractSecurityTestCase
11+ {
12+
13+ /**
14+ * Returns the lines where errors should occur.
15+ *
16+ * The key of the array should represent the line number and the value
17+ * should represent the number of errors that should occur on that line.
18+ *
19+ * @return array<int, int>
20+ */
21+ public function getErrorList ()
22+ {
23+ return [
24+ 3 => 1 ,
25+ 4 => 1 ,
26+ 5 => 1 ,
27+ ];
28+ }
29+
30+ /**
31+ * Returns the lines where warnings should occur.
32+ *
33+ * The key of the array should represent the line number and the value
34+ * should represent the number of warnings that should occur on that line.
35+ *
36+ * @return array<int, int>
37+ */
38+ public function getWarningList ()
39+ {
40+ return [];
41+ }
42+ }
You can’t perform that action at this time.
0 commit comments