File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -32,16 +32,18 @@ if ($argc === 1) {
3232$ exit = 0 ;
3333$ root = simplexml_load_string ($ xml );
3434
35- foreach ($ root as $ file ) {
36- $ filename = (string )$ file ['name ' ];
35+ if ($ root ) {
36+ foreach ($ root as $ file ) {
37+ $ filename = (string )$ file ['name ' ];
3738
38- foreach ($ file as $ error ) {
39- $ type = (string ) $ error ['severity ' ];
40- $ line = (string ) $ error ['line ' ];
41- $ message = (string ) $ error ['message ' ];
39+ foreach ($ file as $ error ) {
40+ $ type = (string ) $ error ['severity ' ];
41+ $ line = (string ) $ error ['line ' ];
42+ $ message = (string ) $ error ['message ' ];
4243
43- annotateCheck (annotateType ($ type ), relativePath ($ filename ), $ line , $ message );
44- $ exit = 1 ;
44+ annotateCheck (annotateType ($ type ), relativePath ($ filename ), $ line , $ message );
45+ $ exit = 1 ;
46+ }
4547 }
4648}
4749
You can’t perform that action at this time.
0 commit comments