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

Method to_message

src/parser/mod.rs:401–408  ·  view source on GitHub ↗

Build a deprecation message string suitable for storing in `deprecation_message` on `ClassInfo`, `MethodInfo`, etc. Combines `reason` and `since` into a single human-readable line. Returns an empty string when neither field is set (bare `#[Deprecated]`).

(&self)

Source from the content-addressed store, hash-verified

399 /// Returns an empty string when neither field is set (bare
400 /// `#[Deprecated]`).
401 pub fn to_message(&self) -> String {
402 match (&self.reason, &self.since) {
403 (Some(reason), Some(since)) => format!("{} (since PHP {})", reason, since),
404 (Some(reason), None) => reason.clone(),
405 (None, Some(since)) => format!("since PHP {}", since),
406 (None, None) => String::new(),
407 }
408 }
409}
410
411/// Merge a docblock `@deprecated` message with a `#[Deprecated]` attribute.

Callers 1

merge_deprecation_infoFunction · 0.80

Calls 1

cloneMethod · 0.80

Tested by

no test coverage detected