File tree 1 file changed +16
-11
lines changed
1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -372,17 +372,22 @@ it returns the value of `SOURCE' as it is."
372
372
" Read JSON string from BUFFER."
373
373
(with-current-buffer buffer
374
374
(goto-char (point-min ))
375
- ; ; Ignore STDERR
376
- (save-match-data
377
- (when (search-forward-regexp " ^{" nil t )
378
- (backward-char 1 )
379
- (delete-region (point-min ) (point ))))
380
- (if (eval-when-compile (and (fboundp 'json-serialize )
381
- (fboundp 'json-parse-buffer )))
382
- (with-no-warnings
383
- (json-parse-buffer :object-type 'plist :array-type 'list ))
384
- (let ((json-object-type 'plist ) (json-array-type 'list ))
385
- (json-read-object )))))
375
+ (if (not (looking-at-p " {" ))
376
+ (let ((msg (string-trim (buffer-substring-no-properties (point-min ) (point-max ))))
377
+ (pattern (eval-when-compile (regexp-quote " No files found to analyse." ))))
378
+ (prog1 nil
379
+ (unless (string-match-p pattern msg)
380
+ (message " [PHPStan]: %s " msg))))
381
+ ; ; Ignore STDERR
382
+ (save-match-data
383
+ (when (search-forward-regexp " ^{" nil t )
384
+ (backward-char 1 )
385
+ (delete-region (point-min ) (point ))))
386
+ (static-if (and (fboundp 'json-serialize ) (fboundp 'json-parse-buffer ))
387
+ (with-no-warnings
388
+ (json-parse-buffer :object-type 'plist :array-type 'list ))
389
+ (let ((json-object-type 'plist ) (json-array-type 'list ))
390
+ (json-read-object ))))))
386
391
387
392
(defun phpstan--expand-file-name (name )
388
393
" Expand file name by NAME."
You can’t perform that action at this time.
0 commit comments