pub struct PhpGetterMap {
pub getters: HashMap<String, HashSet<String>>,
pub field_types: HashMap<String, HashMap<String, String>>,
pub root_type: Option<String>,
}Expand description
Per-type PHP getter classification + chain-resolution metadata.
Holds enough information to resolve a multi-segment field path through the IR’s nested type graph and pick the correct accessor style at each segment:
getters[type_name]— set of field names ontype_namewhose PHP binding uses a#[php(getter)]method (caller must emit->getCamelCase()).field_types[type_name][field_name]— the IR-resolvedNamedtype thatfield_nametraverses into, used to advance the “current type” cursor for the next path segment. Absent for terminal/scalar fields.root_type— the IR type name backing the result variable at the start of any chain. WhenNone, chain traversal degrades to per-segment lookup using a flattened union across all types (legacy bare-name behaviour), which produces false positives when field names collide across types.
Fields§
§getters: HashMap<String, HashSet<String>>§field_types: HashMap<String, HashMap<String, String>>§root_type: Option<String>Implementations§
Source§impl PhpGetterMap
impl PhpGetterMap
Sourcepub fn needs_getter(&self, owner_type: Option<&str>, field_name: &str) -> bool
pub fn needs_getter(&self, owner_type: Option<&str>, field_name: &str) -> bool
Returns true if (owner_type, field_name) requires getter-method syntax.
When owner_type is None (root type unknown, or chain advanced into an
unmapped type), falls back to the union across all types: any type
declaring field_name as non-scalar marks it as needing a getter. This
is the legacy behaviour and is unsafe when field names collide.
Trait Implementations§
Source§impl Clone for PhpGetterMap
impl Clone for PhpGetterMap
Source§fn clone(&self) -> PhpGetterMap
fn clone(&self) -> PhpGetterMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PhpGetterMap
impl Debug for PhpGetterMap
Source§impl Default for PhpGetterMap
impl Default for PhpGetterMap
Source§fn default() -> PhpGetterMap
fn default() -> PhpGetterMap
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PhpGetterMap
impl RefUnwindSafe for PhpGetterMap
impl Send for PhpGetterMap
impl Sync for PhpGetterMap
impl Unpin for PhpGetterMap
impl UnsafeUnpin for PhpGetterMap
impl UnwindSafe for PhpGetterMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more