MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / parse_non_ignorable_diagnostic

Function parse_non_ignorable_diagnostic

src/phpstan.rs:644–669  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

642
643 #[test]
644 fn parse_non_ignorable_diagnostic() {
645 let json = r#"{
646 "totals": {"errors": 0, "file_errors": 1},
647 "files": {
648 "/project/src/Foo.php": {
649 "errors": 1,
650 "messages": [
651 {
652 "message": "Private method Foo::bar() overriding public method Parent::bar() should also be public.",
653 "line": 10,
654 "ignorable": false,
655 "identifier": "method.visibility"
656 }
657 ]
658 }
659 },
660 "errors": []
661 }"#;
662 let path = Path::new("/project/src/Foo.php");
663 let diags = parse_phpstan_json(json, path).unwrap();
664 assert_eq!(diags.len(), 1);
665 assert_eq!(
666 diags[0].data,
667 Some(serde_json::json!({ "ignorable": false }))
668 );
669 }
670
671 #[test]
672 fn parse_ignorable_defaults_true_when_field_absent() {

Callers

nothing calls this directly

Calls 2

parse_phpstan_jsonFunction · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected