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)
| 1849 | /// The comparison is case-insensitive for `self` and `static`. |
| 1850 | /// `$this` is matched literally (it is always lowercase in PHP). |
| 1851 | pub(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`. |
no outgoing calls
no test coverage detected