use serde::Deserialize;
use serde::Serialize;
use mago_interner::StringIdentifier;
use mago_source::HasSource;
use mago_source::SourceIdentifier;
use mago_span::HasSpan;
use mago_span::Span;
use crate::attribute::AttributeReflection;
use crate::r#type::TypeReflection;
#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize, PartialOrd, Ord)]
pub struct FunctionLikeParameterReflection {
pub attribute_reflections: Vec<AttributeReflection>,
pub type_reflection: Option<TypeReflection>,
pub name: StringIdentifier,
pub is_variadic: bool,
pub is_passed_by_reference: bool,
pub is_promoted_property: bool,
pub default: Option<FunctionLikeParameterDefaultValueReflection>,
pub span: Span,
}
impl HasSpan for FunctionLikeParameterReflection {
fn span(&self) -> Span {
self.span
}
}
impl HasSource for FunctionLikeParameterReflection {
fn source(&self) -> SourceIdentifier {
self.span().source()
}
}
#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize, PartialOrd, Ord)]
pub struct FunctionLikeParameterDefaultValueReflection {
pub type_reflection: TypeReflection,
pub span: Span,
}
impl HasSpan for FunctionLikeParameterDefaultValueReflection {
fn span(&self) -> Span {
self.span
}
}
impl HasSource for FunctionLikeParameterDefaultValueReflection {
fn source(&self) -> SourceIdentifier {
self.span.source()
}
}