Helper: same as `collect` but with a specific PHP version.
(php: &str, version: PhpVersion)
| 522 | |
| 523 | /// Helper: same as `collect` but with a specific PHP version. |
| 524 | fn collect_with_version(php: &str, version: PhpVersion) -> Vec<Diagnostic> { |
| 525 | let backend = Backend::new_test(); |
| 526 | backend.set_php_version(version); |
| 527 | let uri = "file:///test.php"; |
| 528 | backend.update_ast(uri, php); |
| 529 | let mut out = Vec::new(); |
| 530 | backend.collect_unused_variable_diagnostics(uri, php, &mut out); |
| 531 | out |
| 532 | } |
| 533 | |
| 534 | // ═══════════════════════════════════════════════════════════════ |
| 535 | // PHP version gating for catch variables |