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

Function is_null_expr

src/completion/variable/forward_walk.rs:8456–8466  ·  view source on GitHub ↗

Check if an expression is `null`.

(expr: &Expression<'_>)

Source from the content-addressed store, hash-verified

8454
8455/// Check if an expression is `null`.
8456fn is_null_expr(expr: &Expression<'_>) -> bool {
8457 match expr {
8458 Expression::Literal(Literal::Null(_)) => true,
8459 Expression::ConstantAccess(ca) => {
8460 let name = ca.name.value();
8461 let clean = crate::util::strip_fqn_prefix(name);
8462 clean.eq_ignore_ascii_case("null")
8463 }
8464 _ => false,
8465 }
8466}
8467
8468/// Extract a direct variable name from an expression.
8469fn expr_to_var_name(expr: &Expression<'_>) -> Option<String> {

Callers 2

Calls 1

strip_fqn_prefixFunction · 0.85

Tested by

no test coverage detected