pub struct PropertyDef {Show 13 fields
pub name: Arc<str>,
pub ty: Option<Arc<Type>>,
pub inferred_ty: Option<Arc<Type>>,
pub visibility: Visibility,
pub is_static: bool,
pub is_readonly: bool,
pub default: Option<Arc<Type>>,
pub location: Option<Location>,
pub deprecated: Option<Arc<str>>,
pub has_native_type: bool,
pub from_docblock: bool,
pub has_native_readonly: bool,
pub native_ty: Option<Arc<Type>>,
}Fields§
§name: Arc<str>§ty: Option<Arc<Type>>Declared/inferred/default types. Stored as Option<Arc<Type>> (8 B)
rather than inline Option<Type> (176 B, no niche) and interned via the
global pool on construction/deserialization — common property types
(string, int, a shared class type) dedup to one allocation. Mirrors
DeclaredParam::ty. On-disk format is unchanged (the serde helpers (de)serialize
the inner Type transparently).
inferred_ty: Option<Arc<Type>>§visibility: Visibility§is_static: bool§is_readonly: bool§default: Option<Arc<Type>>§location: Option<Location>§deprecated: Option<Arc<str>>@deprecated docblock annotation, if present.
has_native_type: boolTrue when the property declares a PHP native type hint (public int $x).
A property typed only via a @var docblock (or untyped entirely) is
false: PHP gives such a property an implicit null default, so it is
never “uninitialized” (no MissingConstructor) and accepts null on
assignment regardless of the advisory docblock type.
from_docblock: boolTrue when this entry was synthesised from a @property / @property-read /
@property-write docblock tag rather than a real PHP property declaration.
Such entries describe magic properties accessible via __get/__set and
do not participate in PHP’s inheritance visibility rules.
has_native_readonly: boolTrue when readonly comes from a native PHP keyword (readonly modifier or
readonly class). False when only a @readonly docblock annotation is present.
Distinguishes PHP-enforced read-only from advisory documentation.
native_ty: Option<Arc<Type>>The PHP native type hint alone, with any @var docblock refinement stripped —
None when has_native_type is false. ty mixes in the docblock type when
present, which makes it unsuitable for checking PHP’s redeclared-property
type invariance rule: that rule is enforced by the runtime purely on the
native hint, never on the (unenforced) docblock annotation.
Trait Implementations§
Source§impl Clone for PropertyDef
impl Clone for PropertyDef
Source§fn clone(&self) -> PropertyDef
fn clone(&self) -> PropertyDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more