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

Function is_self_or_static

src/util.rs:1851–1853  ·  view source on GitHub ↗

Returns `true` if `s` is one of the PHP keywords that refer to the current* class (not the parent): `self`, `static`, or `$this`. Callers that also need to match `parent` should add a separate `eq_ignore_ascii_case("parent")` check, because `parent` resolves to the *parent* class rather than the current one. The comparison is case-insensitive for `self` and `static`. `$this` is matched literally

(s: &str)

Source from the content-addressed store, hash-verified

1849/// The comparison is case-insensitive for `self` and `static`.
1850/// `$this` is matched literally (it is always lowercase in PHP).
1851pub(crate) fn is_self_or_static(s: &str) -> bool {
1852 s.eq_ignore_ascii_case("self") || s.eq_ignore_ascii_case("static") || s == "$this"
1853}
1854
1855/// Returns `true` if `s` is one of the PHP class-keyword references:
1856/// `self`, `static`, `$this`, or `parent`.

Callers 6

is_class_keywordFunction · 0.85
resolve_class_keywordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected