Check whether a parameter is available for the given PHP version based on its `#[PhpStormStubsElementAvailable]` attributes. Same logic as [`is_available_for_version`] but operates on a single parameter's attribute lists.
(
param: &function_like::parameter::FunctionLikeParameter<'_>,
ctx: &DocblockCtx<'_>,
php_version: PhpVersion,
)
| 169 | /// Same logic as [`is_available_for_version`] but operates on a single |
| 170 | /// parameter's attribute lists. |
| 171 | pub(crate) fn is_param_available_for_version( |
| 172 | param: &function_like::parameter::FunctionLikeParameter<'_>, |
| 173 | ctx: &DocblockCtx<'_>, |
| 174 | php_version: PhpVersion, |
| 175 | ) -> bool { |
| 176 | if let Some(avail) = extract_version_availability(¶m.attribute_lists, ctx) { |
| 177 | php_version.matches_range(avail.from, avail.to) |
| 178 | } else { |
| 179 | true |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | /// Extract the `from` / `to` version range from a |
| 184 | /// `#[PhpStormStubsElementAvailable(...)]` attribute, if present. |
no test coverage detected