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)
| 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. |
no test coverage detected