File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 5858(require 'php-runtime )
5959
6060(eval-when-compile
61- (require 'php ))
61+ (require 'php )
62+ (require 'json ))
6263
6364; ; Variables:
6465(defgroup phpstan nil
@@ -294,6 +295,17 @@ it returns the value of `SOURCE' as it is."
294295 " Return --memory-limit value."
295296 phpstan-memory-limit)
296297
298+ (defun phpstan--parse-json (buffer )
299+ " Read JSON string from BUFFER."
300+ (with-current-buffer buffer
301+ (goto-char (point-min ))
302+ (if (eval-when-compile (and (fboundp 'json-serialize )
303+ (fboundp 'json-parse-buffer )))
304+ (with-no-warnings
305+ (json-parse-buffer :object-type 'plist :array-type 'list ))
306+ (let ((json-object-type 'plist ) (json-array-type 'list ))
307+ (json-read-object )))))
308+
297309;;;### autoload
298310(defun phpstan-analyze-this-file ()
299311 " Analyze current buffer-file using PHPStan."
You can’t perform that action at this time.
0 commit comments