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

Function symbol_info_function_params

tests/unit/phpdoc_internals.rs:1146–1172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1144
1145#[test]
1146fn symbol_info_function_params() {
1147 let content = concat!(
1148 "<?php\n",
1149 "/**\n",
1150 " * @\n",
1151 " */\n",
1152 "function greet(string $name, int $age): string {\n",
1153 " return '';\n",
1154 "}\n",
1155 );
1156 let pos = Position {
1157 line: 2,
1158 character: 4,
1159 };
1160 let info = extract_symbol_info(content, pos);
1161
1162 assert_eq!(info.params.len(), 2);
1163 assert_eq!(
1164 info.params[0],
1165 (Some(PhpType::parse("string")), "$name".to_string())
1166 );
1167 assert_eq!(
1168 info.params[1],
1169 (Some(PhpType::parse("int")), "$age".to_string())
1170 );
1171 assert_eq!(info.return_type, Some(PhpType::parse("string")));
1172}
1173
1174#[test]
1175fn symbol_info_method_no_type_hints() {

Callers

nothing calls this directly

Calls 1

extract_symbol_infoFunction · 0.85

Tested by

no test coverage detected