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

Function parameter_is_write

src/scope_collector/tests.rs:88–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86
87#[test]
88fn parameter_is_write() {
89 let php = r#"<?php
90function test($a, $b) {
91 return $a + $b;
92}
93"#;
94 let scope_map = collect_from_function(php);
95
96 // Parameters are writes.
97 assert_eq!(count_kind(&scope_map, "$a", AccessKind::Write), 1);
98 assert_eq!(count_kind(&scope_map, "$b", AccessKind::Write), 1);
99 // Return reads both.
100 assert_eq!(count_kind(&scope_map, "$a", AccessKind::Read), 1);
101 assert_eq!(count_kind(&scope_map, "$b", AccessKind::Read), 1);
102}
103
104#[test]
105fn multiple_assignments() {

Callers

nothing calls this directly

Calls 1

collect_from_functionFunction · 0.85

Tested by

no test coverage detected