Skip to main content

PhpDocTag

Enum PhpDocTag 

Source
pub enum PhpDocTag<'src> {
Show 29 variants Param { type_str: Option<&'src str>, name: Option<&'src str>, description: Option<Cow<'src, str>>, }, Return { type_str: Option<&'src str>, description: Option<Cow<'src, str>>, }, Var { type_str: Option<&'src str>, name: Option<&'src str>, description: Option<Cow<'src, str>>, }, Throws { type_str: Option<&'src str>, description: Option<Cow<'src, str>>, }, Deprecated { description: Option<Cow<'src, str>>, }, Template { name: &'src str, bound: Option<&'src str>, }, Extends { type_str: &'src str, }, Implements { type_str: &'src str, }, Method { signature: &'src str, }, Property { type_str: Option<&'src str>, name: Option<&'src str>, description: Option<Cow<'src, str>>, }, PropertyRead { type_str: Option<&'src str>, name: Option<&'src str>, description: Option<Cow<'src, str>>, }, PropertyWrite { type_str: Option<&'src str>, name: Option<&'src str>, description: Option<Cow<'src, str>>, }, See { reference: &'src str, }, Link { url: &'src str, }, Since { version: &'src str, }, Author { name: &'src str, }, Internal, InheritDoc, Assert { type_str: Option<&'src str>, name: Option<&'src str>, }, TypeAlias { name: Option<&'src str>, type_str: Option<&'src str>, }, ImportType { body: &'src str, }, Suppress { rules: &'src str, }, Pure, Readonly, Immutable, Mixin { class: &'src str, }, TemplateCovariant { name: &'src str, bound: Option<&'src str>, }, TemplateContravariant { name: &'src str, bound: Option<&'src str>, }, Generic { tag: &'src str, body: Option<Cow<'src, str>>, },
}
Expand description

A single PHPDoc tag (e.g. @param int $x The value).

Variants§

§

Param

@param [type] $name [description]

Fields

§type_str: Option<&'src str>
§name: Option<&'src str>
§description: Option<Cow<'src, str>>
§

Return

@return [type] [description]

Fields

§type_str: Option<&'src str>
§description: Option<Cow<'src, str>>
§

Var

@var [type] [$name] [description]

Fields

§type_str: Option<&'src str>
§name: Option<&'src str>
§description: Option<Cow<'src, str>>
§

Throws

@throws [type] [description]

Fields

§type_str: Option<&'src str>
§description: Option<Cow<'src, str>>
§

Deprecated

@deprecated [description]

Fields

§description: Option<Cow<'src, str>>
§

Template

@template T [of bound]

Fields

§name: &'src str
§bound: Option<&'src str>
§

Extends

@extends [type]

Fields

§type_str: &'src str
§

Implements

@implements [type]

Fields

§type_str: &'src str
§

Method

@method [static] [return_type] name(params) [description]

Fields

§signature: &'src str
§

Property

@property [type] $name [description]

Fields

§type_str: Option<&'src str>
§name: Option<&'src str>
§description: Option<Cow<'src, str>>
§

PropertyRead

@property-read [type] $name [description]

Fields

§type_str: Option<&'src str>
§name: Option<&'src str>
§description: Option<Cow<'src, str>>
§

PropertyWrite

@property-write [type] $name [description]

Fields

§type_str: Option<&'src str>
§name: Option<&'src str>
§description: Option<Cow<'src, str>>
§

See

@see [reference] [description]

Fields

§reference: &'src str

@link [url] [description]

Fields

§url: &'src str
§

Since

@since [version] [description]

Fields

§version: &'src str
§

Author

@author name [<email>]

Fields

§name: &'src str
§

Internal

@internal

§

InheritDoc

@inheritdoc / {@inheritdoc}

§

Assert

@psalm-assert, @phpstan-assert — assert that a parameter has a type after the call.

Fields

§type_str: Option<&'src str>
§name: Option<&'src str>
§

TypeAlias

@psalm-type, @phpstan-type — local type alias (@type Foo = int|string).

Fields

§name: Option<&'src str>
§type_str: Option<&'src str>
§

ImportType

@psalm-import-type, @phpstan-import-type — import a type alias from another class.

Fields

§body: &'src str
§

Suppress

@psalm-suppress, @phpstan-ignore-next-line, @phpstan-ignore — suppress diagnostics.

Fields

§rules: &'src str
§

Pure

@psalm-pure, @psalm-immutable, @psalm-readonly — purity/immutability markers.

§

Readonly

@psalm-readonly, @readonly — marks a property as read-only.

§

Immutable

@psalm-immutable — marks a class as immutable.

§

Mixin

@mixin [class] — indicates the class delegates calls to another.

Fields

§class: &'src str
§

TemplateCovariant

@template-covariant T [of bound]

Fields

§name: &'src str
§bound: Option<&'src str>
§

TemplateContravariant

@template-contravariant T [of bound]

Fields

§name: &'src str
§bound: Option<&'src str>
§

Generic

Any tag not specifically recognized: @tagname [body]

Fields

§tag: &'src str
§body: Option<Cow<'src, str>>

Trait Implementations§

Source§

impl<'src> Debug for PhpDocTag<'src>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'src> Freeze for PhpDocTag<'src>

§

impl<'src> RefUnwindSafe for PhpDocTag<'src>

§

impl<'src> Send for PhpDocTag<'src>

§

impl<'src> Sync for PhpDocTag<'src>

§

impl<'src> Unpin for PhpDocTag<'src>

§

impl<'src> UnsafeUnpin for PhpDocTag<'src>

§

impl<'src> UnwindSafe for PhpDocTag<'src>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.