A

AttributeClass in namespace Nette\PhpGenerator

Definition of a PHP attribute.

ClassType::addImplement() — Method in class ClassType
ClassType::addMember() — Method in class ClassType

Adds a member to the class.

Closure::addUse() — Method in class Closure

Adds a variable binding to the closure's use list.

EnumType::addImplement() — Method in class EnumType
EnumType::addCase() — Method in class EnumType

Adds a case to the enum.

EnumType::addMember() — Method in class EnumType

Adds a member to the enum.

InterfaceType::addExtend() — Method in class InterfaceType

Adds a parent interface.

InterfaceType::addMember() — Method in class InterfaceType

Adds a member to the interface.

Method::addPromotedParameter() — Method in class Method

Adds a constructor-promoted parameter. If it already exists, overwrites it.

PhpFile::add() — Method in class PhpFile

Adds a namespace, class-like type, or function to the file.

PhpFile::addClass() — Method in class PhpFile

Adds a class to the file. Accepts the fully qualified name including namespace.

PhpFile::addInterface() — Method in class PhpFile

Adds an interface to the file. Accepts the fully qualified name including namespace.

PhpFile::addTrait() — Method in class PhpFile

Adds a trait to the file. Accepts the fully qualified name including namespace.

PhpFile::addEnum() — Method in class PhpFile

Adds an enum to the file. Accepts the fully qualified name including namespace.

PhpFile::addFunction() — Method in class PhpFile

Adds a function to the file. Accepts the fully qualified name including namespace.

PhpFile::addNamespace() — Method in class PhpFile

Adds a namespace to the file, or returns the existing one if it already exists.

PhpFile::addUse() — Method in class PhpFile

Adds a use statement to the root (unnamed) namespace.

PhpNamespace::addUse() — Method in class PhpNamespace

Adds a use statement for a class, function, or constant.

PhpNamespace::addUseFunction() — Method in class PhpNamespace

Adds a use statement for a function.

PhpNamespace::addUseConstant() — Method in class PhpNamespace

Adds a use statement for a constant.

PhpNamespace::add() — Method in class PhpNamespace

Adds a class-like type or function to the namespace.

PhpNamespace::addClass() — Method in class PhpNamespace

Adds a class to the namespace.

PhpNamespace::addInterface() — Method in class PhpNamespace

Adds an interface to the namespace.

PhpNamespace::addTrait() — Method in class PhpNamespace

Adds a trait to the namespace.

PhpNamespace::addEnum() — Method in class PhpNamespace

Adds an enum to the namespace.

PhpNamespace::addFunction() — Method in class PhpNamespace

Adds a function to the namespace.

PropertyHook::addParameter() — Method in class PropertyHook

Adds a parameter. If it already exists, it overwrites it.

TraitType::addMember() — Method in class TraitType

Adds a member to the trait.

TraitUse::addResolution() — Method in class TraitUse

Adds a conflict resolution rule (e.g., 'methodA insteadof TraitB' or 'methodA as protected').

AttributeAwareClass in namespace Nette\PhpGenerator\Traits
AttributeAware::addAttribute() — Method in class AttributeAware
CommentAware::addComment() — Method in class CommentAware

Adds a new line to the comment.

ConstantsAware::addConstant() — Method in class ConstantsAware

Adds a constant.

FunctionLike::addBody() — Method in class FunctionLike

Appends a line to the function body. Optionally accepts Dumper-style placeholders resolved against $args.

FunctionLike::addParameter() — Method in class FunctionLike

Adds a parameter. If it already exists, it overwrites it.

MethodsAware::addMethod() — Method in class MethodsAware

Adds a method.

PropertiesAware::addProperty() — Method in class PropertiesAware

Adds a property.

PropertyLike::addHook() — Method in class PropertyLike

Adds a get or set hook. When $shortBody is provided, it is used as an arrow-function-style body.

TraitsAware::addTrait() — Method in class TraitsAware

Adds a trait use statement.

B

$ Printer#bracesOnNextLineProperty in class Printer

C

ClassLikeClass in namespace Nette\PhpGenerator

Base for class, interface, trait, and enum definitions.

ClassManipulatorClass in namespace Nette\PhpGenerator

Provides advanced manipulation of a ClassType, such as inheriting members from parent classes or implementing interfaces.

ClassTypeClass in namespace Nette\PhpGenerator

Definition of a class with properties, methods, constants, traits and PHP attributes.

ClosureClass in namespace Nette\PhpGenerator

Definition of a closure.

ConstantClass in namespace Nette\PhpGenerator

Definition of a class constant.

$ Dumper#customObjectsProperty in class Dumper
$ Dumper#contextProperty in class Dumper
Dumper::createObject() — Method in class Dumper
Helpers::createObject() — Method in class Helpers
CommentAwareClass in namespace Nette\PhpGenerator\Traits
ConstantsAwareClass in namespace Nette\PhpGenerator\Traits
NameAware::cloneWithName() — Method in class NameAware

Returns clone with a different name.

D

DumperClass in namespace Nette\PhpGenerator

Generates a PHP representation of a variable.

Dumper::dump() — Method in class Dumper

Converts a value to its PHP code representation.

$ Printer#declareOnOpenTagProperty in class Printer
$ Printer#dumperProperty in class Printer
Printer::dump() — Method in class Printer

E

EnumCaseClass in namespace Nette\PhpGenerator

Definition of an enum case.

EnumTypeClass in namespace Nette\PhpGenerator

Definition of an enum with cases, methods, constants and traits.

ExtractorClass in namespace Nette\PhpGenerator

Extracts information from PHP code.

Extractor::extractMethodBodies() — Method in class Extractor
Extractor::extractPropertyHookBodies() — Method in class Extractor
Extractor::extractFunctionBody() — Method in class Extractor
Extractor::extractAll() — Method in class Extractor
Helpers::extractNamespace() — Method in class Helpers
Helpers::extractShortName() — Method in class Helpers

F

ClassLike::from() — Method in class ClassLike

Creates an instance from a class reflection.

ClassLike::fromCode() — Method in class ClassLike

Creates an instance by parsing PHP source code containing a class definition.

Closure::from() — Method in class Closure
Dumper::format() — Method in class Dumper

Formats a PHP expression using placeholders.

FactoryClass in namespace Nette\PhpGenerator

Creates PhpGenerator representations from reflection objects or PHP source code.

Factory::fromClassReflection() — Method in class Factory

Creates a ClassLike instance from a reflection object.

Factory::fromMethodReflection() — Method in class Factory
Factory::fromFunctionReflection() — Method in class Factory

Creates a GlobalFunction or Closure instance from a reflection object.

Factory::fromCallable() — Method in class Factory
Factory::fromParameterReflection() — Method in class Factory
Factory::fromConstantReflection() — Method in class Factory
Factory::fromCaseReflection() — Method in class Factory
Factory::fromPropertyReflection() — Method in class Factory
Factory::fromObject() — Method in class Factory
Factory::fromClassCode() — Method in class Factory

Parses PHP source code and returns the first class-like type found.

Factory::fromCode() — Method in class Factory

Parses PHP source code and returns the resulting PhpFile representation.

GlobalFunction::from() — Method in class GlobalFunction
Helpers::formatDocComment() — Method in class Helpers
Literal::formatWith() — Method in class Literal
Method::from() — Method in class Method

Creates an instance from a method name, callable array, or closure reflection.

PhpFile::fromCode() — Method in class PhpFile

Parses PHP source code and returns the resulting PhpFile representation.

FunctionLikeClass in namespace Nette\PhpGenerator\Traits

G

Attribute::getName() — Method in class Attribute
Attribute::getArguments() — Method in class Attribute
ClassLike::getNamespace() — Method in class ClassLike
ClassLike::getName() — Method in class ClassLike
ClassLike::getFullName() — Method in class ClassLike

Returns the fully qualified name including namespace, or just the short name if no namespace is set.

ClassType::getExtends() — Method in class ClassType
ClassType::getImplements() — Method in class ClassType
Closure::getUses() — Method in class Closure
Constant::getValue() — Method in class Constant
Constant::getType() — Method in class Constant
EnumCase::getValue() — Method in class EnumCase
EnumType::getType() — Method in class EnumType

Returns the backing type ('int' or 'string'), or null for a pure enum.

EnumType::getImplements() — Method in class EnumType
EnumType::getCases() — Method in class EnumType
GlobalFunctionClass in namespace Nette\PhpGenerator

Definition of a global function.

InterfaceType::getExtends() — Method in class InterfaceType
Parameter::getType() — Method in class Parameter
Parameter::getDefaultValue() — Method in class Parameter
PhpFile::getNamespaces() — Method in class PhpFile
PhpFile::getClasses() — Method in class PhpFile
PhpFile::getFunctions() — Method in class PhpFile
PhpNamespace::getName() — Method in class PhpNamespace
PhpNamespace::getUses() — Method in class PhpNamespace

Returns use statements, sorted alphabetically and excluding redundant aliases within the same namespace.

PhpNamespace::getClass() — Method in class PhpNamespace

Returns a class-like type by name.

PhpNamespace::getClasses() — Method in class PhpNamespace
PhpNamespace::getFunction() — Method in class PhpNamespace

Returns a function by name.

PhpNamespace::getFunctions() — Method in class PhpNamespace
Property::getValue() — Method in class Property
Property::getType() — Method in class Property
PropertyHook::getBody() — Method in class PropertyHook
PropertyHook::getParameters() — Method in class PropertyHook
PropertyHook::getReturnReference() — Method in class PropertyHook
TraitUse::getResolutions() — Method in class TraitUse
AttributeAware::getAttributes() — Method in class AttributeAware
CommentAware::getComment() — Method in class CommentAware
ConstantsAware::getConstants() — Method in class ConstantsAware
ConstantsAware::getConstant() — Method in class ConstantsAware
FunctionLike::getBody() — Method in class FunctionLike
FunctionLike::getParameters() — Method in class FunctionLike
FunctionLike::getParameter() — Method in class FunctionLike
FunctionLike::getReturnType() — Method in class FunctionLike
FunctionLike::getReturnReference() — Method in class FunctionLike
MethodsAware::getMethods() — Method in class MethodsAware
MethodsAware::getMethod() — Method in class MethodsAware
NameAware::getName() — Method in class NameAware
PropertiesAware::getProperties() — Method in class PropertiesAware
PropertiesAware::getProperty() — Method in class PropertiesAware
PropertyLike::getVisibility() — Method in class PropertyLike
PropertyLike::getHooks() — Method in class PropertyLike
PropertyLike::getHook() — Method in class PropertyLike
TraitsAware::getTraits() — Method in class TraitsAware
VisibilityAware::getVisibility() — Method in class VisibilityAware

H

HelpersClass in namespace Nette\PhpGenerator
Parameter::hasDefaultValue() — Method in class Parameter
PhpFile::hasStrictTypes() — Method in class PhpFile
PhpNamespace::hasBracketedSyntax() — Method in class PhpNamespace
ConstantsAware::hasConstant() — Method in class ConstantsAware
FunctionLike::hasParameter() — Method in class FunctionLike
MethodsAware::hasMethod() — Method in class MethodsAware
PropertiesAware::hasProperty() — Method in class PropertiesAware
PropertyLike::hasHook() — Method in class PropertyLike
TraitsAware::hasTrait() — Method in class TraitsAware

I

ClassLike::isClass() — Method in class ClassLike
ClassLike::isInterface() — Method in class ClassLike
ClassLike::isTrait() — Method in class ClassLike
ClassLike::isEnum() — Method in class ClassLike
ClassManipulator::inheritProperty() — Method in class ClassManipulator

Copies a property from a parent class into this class for overriding.

ClassManipulator::inheritMethod() — Method in class ClassManipulator

Copies a method from a parent class or interface into this class for overriding.

ClassManipulator::implement() — Method in class ClassManipulator

Adds stub implementations for all abstract methods and properties from the given interface or abstract class.

ClassType::isFinal() — Method in class ClassType
ClassType::isAbstract() — Method in class ClassType
ClassType::isReadOnly() — Method in class ClassType
ClassType::inheritProperty() — Method in class ClassType
ClassType::inheritMethod() — Method in class ClassType
Constant::isFinal() — Method in class Constant
$ Dumper#indentationProperty in class Dumper
Helpers::isIdentifier() — Method in class Helpers
Helpers::isNamespaceIdentifier() — Method in class Helpers
InterfaceTypeClass in namespace Nette\PhpGenerator

Definition of an interface with properties, methods and constants.

Method::isStatic() — Method in class Method
Method::isFinal() — Method in class Method
Method::isAbstract() — Method in class Method
Parameter::isReference() — Method in class Parameter
Parameter::isNullable() — Method in class Parameter
$ Printer#indentationProperty in class Printer
Printer::indent() — Method in class Printer
Printer::isBraceOnNextLine() — Method in class Printer
Property::isStatic() — Method in class Property
Property::isNullable() — Method in class Property
Property::isInitialized() — Method in class Property
Property::isAbstract() — Method in class Property
PropertyHook::isShort() — Method in class PropertyHook

Returns true if the hook uses the arrow function style (=> expression), not a block body.

PropertyHook::isFinal() — Method in class PropertyHook
PropertyHook::isAbstract() — Method in class PropertyHook
$ PsrPrinter#indentationProperty in class PsrPrinter
PsrPrinter::isBraceOnNextLine() — Method in class PsrPrinter
FunctionLike::isVariadic() — Method in class FunctionLike
FunctionLike::isReturnNullable() — Method in class FunctionLike
PropertyLike::isPublic() — Method in class PropertyLike
PropertyLike::isProtected() — Method in class PropertyLike
PropertyLike::isPrivate() — Method in class PropertyLike
PropertyLike::isFinal() — Method in class PropertyLike
PropertyLike::isReadOnly() — Method in class PropertyLike
VisibilityAware::isPublic() — Method in class VisibilityAware
VisibilityAware::isProtected() — Method in class VisibilityAware
VisibilityAware::isPrivate() — Method in class VisibilityAware
Type::intersection() — Method in class Type

L

LiteralClass in namespace Nette\PhpGenerator

Raw PHP expression written to output as-is without escaping.

$ Printer#linesBetweenPropertiesProperty in class Printer
$ Printer#linesBetweenMethodsProperty in class Printer
$ Printer#linesBetweenUseTypesProperty in class Printer
$ PsrPrinter#linesBetweenMethodsProperty in class PsrPrinter
$ PsrPrinter#linesBetweenUseTypesProperty in class PsrPrinter

M

$ Dumper#maxDepthProperty in class Dumper
MethodClass in namespace Nette\PhpGenerator

Definition of a class method.

MethodsAwareClass in namespace Nette\PhpGenerator\Traits

N

Literal::new() — Method in class Literal

Creates a literal representing a new ClassName(...) expression with named arguments.

$ Printer#namespaceProperty in class Printer
NameAwareClass in namespace Nette\PhpGenerator\Traits
Type::nullable() — Method in class Type

Adds or removes the nullable modifier from a type. For union types, appends or removes |null.

O

$ Printer#omitEmptyNamespacesProperty in class Printer

P

ParameterClass in namespace Nette\PhpGenerator

Definition of a function/method parameter.

PhpFileClass in namespace Nette\PhpGenerator

Represents a complete PHP file with namespaces, classes, and functions.

PhpLiteralClass in namespace Nette\PhpGenerator
PhpNamespaceClass in namespace Nette\PhpGenerator

Represents a PHP namespace with use statements and contained class-like types and functions.

PrinterClass in namespace Nette\PhpGenerator

Generates PHP code.

Printer::printFunction() — Method in class Printer
Printer::printClosure() — Method in class Printer
Printer::printArrowFunction() — Method in class Printer
Printer::printMethod() — Method in class Printer
Printer::printClass() — Method in class Printer
Printer::printNamespace() — Method in class Printer
Printer::printFile() — Method in class Printer
Printer::printUses() — Method in class Printer

Generates use statements for the given namespace.

Printer::printParameters() — Method in class Printer
Printer::printType() — Method in class Printer
Printer::printDocComment() — Method in class Printer
Printer::printReturnType() — Method in class Printer
Printer::printAttributes() — Method in class Printer
PromotedParameterClass in namespace Nette\PhpGenerator

Definition of a promoted constructor parameter.

PropertyClass in namespace Nette\PhpGenerator

Definition of a class property.

PropertyHookClass in namespace Nette\PhpGenerator

Definition of a property hook.

PsrPrinterClass in namespace Nette\PhpGenerator

Generates PHP code following PSR-2/PSR-12/PER coding style (4-space indentation, braces on same line).

PropertiesAwareClass in namespace Nette\PhpGenerator\Traits
PropertyLikeClass in namespace Nette\PhpGenerator\Traits

R

ClassType::removeImplement() — Method in class ClassType
$ Dumper#referencesProperty in class Dumper
EnumType::removeImplement() — Method in class EnumType
EnumType::removeCase() — Method in class EnumType
PhpFile::removeNamespace() — Method in class PhpFile

Removes a namespace from the file.

PhpNamespace::removeUse() — Method in class PhpNamespace

Removes a use statement.

PhpNamespace::resolveName() — Method in class PhpNamespace

Resolves a relative or aliased name to its fully qualified form.

PhpNamespace::removeClass() — Method in class PhpNamespace

Removes a class-like type from the namespace.

PhpNamespace::removeFunction() — Method in class PhpNamespace

Removes a function from the namespace.

$ Printer#returnTypeColonProperty in class Printer
CommentAware::removeComment() — Method in class CommentAware
ConstantsAware::removeConstant() — Method in class ConstantsAware
FunctionLike::removeParameter() — Method in class FunctionLike
MethodsAware::removeMethod() — Method in class MethodsAware
PropertiesAware::removeProperty() — Method in class PropertiesAware
TraitsAware::removeTrait() — Method in class TraitsAware

S

ClassLike::setNamespace() — Method in class ClassLike
ClassLike::setName() — Method in class ClassLike
ClassType::setFinal() — Method in class ClassType
ClassType::setAbstract() — Method in class ClassType
ClassType::setReadOnly() — Method in class ClassType
ClassType::setExtends() — Method in class ClassType
ClassType::setImplements() — Method in class ClassType
Closure::setUses() — Method in class Closure

Replaces all uses.

Constant::setValue() — Method in class Constant
Constant::setFinal() — Method in class Constant
Constant::setType() — Method in class Constant
EnumCase::setValue() — Method in class EnumCase
EnumType::setType() — Method in class EnumType

Sets the backing type of a backed enum ('int' or 'string').

EnumType::setImplements() — Method in class EnumType
EnumType::setCases() — Method in class EnumType

Replaces all cases.

Helpers::simplifyTaggedNames() — Method in class Helpers
InterfaceType::setExtends() — Method in class InterfaceType
Method::setStatic() — Method in class Method
Method::setFinal() — Method in class Method
Method::setAbstract() — Method in class Method
Parameter::setReference() — Method in class Parameter
Parameter::setType() — Method in class Parameter
Parameter::setNullable() — Method in class Parameter
Parameter::setDefaultValue() — Method in class Parameter
PhpFile::setStrictTypes() — Method in class PhpFile

Enables or disables the declare(strict_types=1) statement.

PhpNamespace::setBracketedSyntax() — Method in class PhpNamespace
PhpNamespace::simplifyType() — Method in class PhpNamespace

Simplifies all class/function/constant names in a type string using current use statements.

PhpNamespace::simplifyName() — Method in class PhpNamespace

Simplifies a fully qualified name to the shortest possible form using current use statements.

$ Printer#singleParameterOnOneLineProperty in class Printer
Printer::setTypeResolving() — Method in class Printer

Enables or disables automatic simplification of fully qualified type names using namespace use statements.

Property::setValue() — Method in class Property
Property::setStatic() — Method in class Property
Property::setType() — Method in class Property
Property::setNullable() — Method in class Property
Property::setInitialized() — Method in class Property
Property::setAbstract() — Method in class Property
PropertyHook::setBody() — Method in class PropertyHook

Sets the hook body. When $short is true, uses arrow-function style (=> expression).

PropertyHook::setFinal() — Method in class PropertyHook
PropertyHook::setAbstract() — Method in class PropertyHook
PropertyHook::setParameters() — Method in class PropertyHook
PropertyHook::setReturnReference() — Method in class PropertyHook
AttributeAware::setAttributes() — Method in class AttributeAware

Replaces all attributes.

CommentAware::setComment() — Method in class CommentAware
ConstantsAware::setConstants() — Method in class ConstantsAware

Replaces all constants.

FunctionLike::setBody() — Method in class FunctionLike

Sets the function body. Optionally accepts Dumper-style placeholders resolved against $args.

FunctionLike::setParameters() — Method in class FunctionLike
FunctionLike::setVariadic() — Method in class FunctionLike
FunctionLike::setReturnType() — Method in class FunctionLike
FunctionLike::setReturnReference() — Method in class FunctionLike
FunctionLike::setReturnNullable() — Method in class FunctionLike
MethodsAware::setMethods() — Method in class MethodsAware

Replaces all methods.

PropertiesAware::setProperties() — Method in class PropertiesAware

Replaces all properties.

PropertyLike::setVisibility() — Method in class PropertyLike

Sets asymmetric visibility for get and set access modes.

PropertyLike::setPublic() — Method in class PropertyLike
PropertyLike::setProtected() — Method in class PropertyLike
PropertyLike::setPrivate() — Method in class PropertyLike
PropertyLike::setFinal() — Method in class PropertyLike
PropertyLike::setReadOnly() — Method in class PropertyLike
PropertyLike::setHooks() — Method in class PropertyLike

Replaces all hooks.

TraitsAware::setTraits() — Method in class TraitsAware

Replaces all traits.

VisibilityAware::setVisibility() — Method in class VisibilityAware
VisibilityAware::setPublic() — Method in class VisibilityAware
VisibilityAware::setProtected() — Method in class VisibilityAware
VisibilityAware::setPrivate() — Method in class VisibilityAware

T

Helpers::tagName() — Method in class Helpers
Helpers::tabsToSpaces() — Method in class Helpers
TraitTypeClass in namespace Nette\PhpGenerator

Definition of a trait with properties, methods, constants and traits.

TraitUseClass in namespace Nette\PhpGenerator

Definition of a trait use statement.

TraitsAwareClass in namespace Nette\PhpGenerator\Traits
TypeClass in namespace Nette\PhpGenerator

Constants and helpers for PHP type declarations.

U

Helpers::unformatDocComment() — Method in class Helpers
Helpers::unindent() — Method in class Helpers
Type::union() — Method in class Type

V

ClassLike::validateNames() — Method in class ClassLike
ClassLike::validate() — Method in class ClassLike
ClassType::validate() — Method in class ClassType
Helpers::validateType() — Method in class Helpers

Validates a type declaration. Strips the leading '?' and sets $nullable=true for nullable shorthand.

InterfaceType::validate() — Method in class InterfaceType
Method::validate() — Method in class Method
Parameter::validate() — Method in class Parameter
PromotedParameter::validate() — Method in class PromotedParameter
Property::validate() — Method in class Property
VisibilityAwareClass in namespace Nette\PhpGenerator\Traits

W

$ Dumper#wrapLengthProperty in class Dumper
$ Printer#wrapLengthProperty in class Printer

_

Attribute::__construct() — Method in class Attribute
ClassLike::__construct() — Method in class ClassLike
ClassLike::__toString() — Method in class ClassLike
ClassLike::__clone() — Method in class ClassLike
ClassManipulator::__construct() — Method in class ClassManipulator
ClassType::__construct() — Method in class ClassType
ClassType::__clone() — Method in class ClassType
Closure::__toString() — Method in class Closure
Closure::__clone() — Method in class Closure
EnumType::__clone() — Method in class EnumType
Extractor::__construct() — Method in class Extractor
GlobalFunction::__toString() — Method in class GlobalFunction
GlobalFunction::__clone() — Method in class GlobalFunction
InterfaceType::__clone() — Method in class InterfaceType
Literal::__construct() — Method in class Literal
Literal::__toString() — Method in class Literal
Method::__toString() — Method in class Method
Method::__clone() — Method in class Method
PhpFile::__toString() — Method in class PhpFile
PhpNamespace::__construct() — Method in class PhpNamespace
PhpNamespace::__toString() — Method in class PhpNamespace
Printer::__construct() — Method in class Printer
PromotedParameter::__clone() — Method in class PromotedParameter
Property::__clone() — Method in class Property
TraitType::__clone() — Method in class TraitType
TraitUse::__construct() — Method in class TraitUse
NameAware::__construct() — Method in class NameAware