File tree 1 file changed +31
-0
lines changed
spec/cc/engine/analyzers/php
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 163
163
"lines" => { "begin" => 11 , "end" => 16 } ,
164
164
} )
165
165
end
166
+
167
+ it "ignores namespace and use declarations" do
168
+ create_source_file ( "foo.php" , <<-EOF )
169
+ <?php
170
+ namespace KeepClear\\ Http\\ Controllers\\ API\\ V1;
171
+ use Illuminate\\ Http\\ Request;
172
+ use KeepClear\\ Http\\ Controllers\\ Controller;
173
+ use KeepClear\\ Models\\ Comment;
174
+ use KeepClear\\ Models\\ User;
175
+ use KeepClear\\ Models\\ Asset;
176
+ use KeepClear\\ Traits\\ Controllers\\ ApiFilter;
177
+ use KeepClear\\ Traits\\ Controllers\\ ApiParseBody;
178
+ use KeepClear\\ Traits\\ Controllers\\ ApiException;
179
+ EOF
180
+
181
+ create_source_file ( "bar.php" , <<-EOF )
182
+ <?php
183
+ namespace KeepClear\\ Http\\ Controllers\\ API\\ V1;
184
+ use Illuminate\\ Http\\ Request;
185
+ use KeepClear\\ Http\\ Controllers\\ Controller;
186
+ use KeepClear\\ Models\\ Comment;
187
+ use KeepClear\\ Models\\ User;
188
+ use KeepClear\\ Models\\ Asset;
189
+ use KeepClear\\ Traits\\ Controllers\\ ApiFilter;
190
+ use KeepClear\\ Traits\\ Controllers\\ ApiParseBody;
191
+ use KeepClear\\ Traits\\ Controllers\\ ApiException;
192
+ EOF
193
+
194
+ issues = run_engine ( engine_conf ) . strip . split ( "\0 " )
195
+ expect ( issues ) . to be_empty
196
+ end
166
197
end
167
198
168
199
def engine_conf
You can’t perform that action at this time.
0 commit comments