phptype

package
v0.0.0-...-520d0b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package phptype declares PHP types that can be used in PHPDoc syntax trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	Elem Type
	// contains filtered or unexported fields
}

An Array represent an array of a specified type.

type ArrayElem

type ArrayElem struct {
	Key      string // or "" if for implicit keys
	Type     Type
	Optional bool
}

An ArrayElem represents a key-value element of ArrayShape.

type ArrayShape

type ArrayShape struct {
	Elems []*ArrayElem
	// contains filtered or unexported fields
}

An ArrayShape represents the structure of key-values of a PHP array in the ordered-map mode.

type Callable

type Callable struct {
	Params []*Param
	Result Type
	// contains filtered or unexported fields
}

type ConstFetch

type ConstFetch struct {
	Class Type
	Name  string
	// contains filtered or unexported fields
}

type Generic

type Generic struct {
	Base       Type
	TypeParams []Type
	// contains filtered or unexported fields
}

Generic represents a pseudo-generic PHP type.

type Intersect

type Intersect struct {
	Types []Type
	// contains filtered or unexported fields
}

An Intersect represents an intersect of types.

type Literal

type Literal struct {
	Value string
	// contains filtered or unexported fields
}

type Named

type Named struct {
	Parts  []string
	Global bool // fully qualified
	// contains filtered or unexported fields
}

Named represents a (possibly qualified or fully qualified) PHP name, which might be a class name, a built-in type, or a special type (e.g. null, true).

type Nullable

type Nullable struct {
	Type Type
	// contains filtered or unexported fields
}

Nullable represents a nullable type.

type ObjectElem

type ObjectElem struct {
	Key      string
	Type     Type
	Optional bool
}

An ObjectElem represents a key-value element of ObjectShape.

type ObjectShape

type ObjectShape struct {
	Elems []*ObjectElem
	// contains filtered or unexported fields
}

An ObjectShape represents the structure of \stdClass.

type Param

type Param struct {
	Type     Type
	ByRef    bool // pass by reference
	Variadic bool
	Name     string
	Default  *Literal // or nil
}

type Paren

type Paren struct {
	Type Type
	// contains filtered or unexported fields
}

A Paren represents a parenthesized type.

type This

type This struct {
	// contains filtered or unexported fields
}

This represents the $this special type.

type Type

type Type interface {
	// contains filtered or unexported methods
}

A Type is the interface that represents all PHP types.

type Union

type Union struct {
	Types []Type
	// contains filtered or unexported fields
}

A Union represents a union of types.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL