File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Tests/VariableAnalysisSniff Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,15 @@ public function testUnusedFollowedByRequireDefault() {
1313 2 ,
1414 3 ,
1515 4 ,
16+ 8 ,
17+ 9 ,
18+ 10 ,
19+ 14 ,
20+ 15 ,
21+ 16 ,
22+ 20 ,
23+ 21 ,
24+ 22 ,
1625 ];
1726 $ this ->assertEquals ($ expectedWarnings , $ lines );
1827 }
@@ -29,6 +38,9 @@ public function testUnusedFollowedByRequireWhenSet() {
2938 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
3039 $ expectedWarnings = [
3140 4 ,
41+ 10 ,
42+ 16 ,
43+ 22 ,
3244 ];
3345 $ this ->assertEquals ($ expectedWarnings , $ lines );
3446 }
Original file line number Diff line number Diff line change 11<?php
22function require_file_function ($ param ) { // unused variable $param
3+ $ var = 'something ' ; // unused variable $var
4+ activate_code ($ data ); // undefined variable $data
5+ require __DIR__ . '/views/my-view.php ' ;
6+ }
7+
8+ function require_once_file_function ($ param ) { // unused variable $param
39 $ var = 'something ' ; // unused variable $var
410 activate_code ($ data ); // undefined variable $data
511 require_once __DIR__ . '/views/my-view.php ' ;
612}
13+
14+ function include_file_function ($ param ) { // unused variable $param
15+ $ var = 'something ' ; // unused variable $var
16+ activate_code ($ data ); // undefined variable $data
17+ include __DIR__ . '/views/my-view.php ' ;
18+ }
19+
20+ function include_once_file_function ($ param ) { // unused variable $param
21+ $ var = 'something ' ; // unused variable $var
22+ activate_code ($ data ); // undefined variable $data
23+ include_once __DIR__ . '/views/my-view.php ' ;
24+ }
You can’t perform that action at this time.
0 commit comments