Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Param.php

class Param

Same name in this branch
  1. 11.1.x vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php \PhpParser\Builder\Param
  2. 11.1.x vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php \phpDocumentor\Reflection\DocBlock\Tags\Param

Hierarchy

  • class \PhpParser\NodeAbstract implements \PhpParser\Node, \PhpParser\JsonSerializable
    • class \PhpParser\Node\Param extends \PhpParser\NodeAbstract

Expanded class hierarchy of Param

3 files declare their use of Param
AssertTypeSpecifyingExtensionHelper.php in vendor/phpstan/phpstan-phpunit/src/Type/PHPUnit/Assert/AssertTypeSpecifyingExtensionHelper.php
ParserAbstract.php in vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php
PrettyPrinterAbstract.php in vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php
5 string references to 'Param'
core.data_types.schema.yml in core/config/schema/core.data_types.schema.yml
core/config/schema/core.data_types.schema.yml
DocBlockFactory::createInstance in vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php
Factory method for easy instantiation.
Param::getType in vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
Gets the type of the node.
Param::__construct in vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php
ParamFactory::create in vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/ParamFactory.php

File

vendor/nikic/php-parser/lib/PhpParser/Node/Param.php, line 9

Namespace

PhpParser\Node
View source
class Param extends NodeAbstract {
    
    /** @var null|Identifier|Name|ComplexType Type declaration */
    public ?Node $type;
    
    /** @var bool Whether parameter is passed by reference */
    public bool $byRef;
    
    /** @var bool Whether this is a variadic argument */
    public bool $variadic;
    
    /** @var Expr\Variable|Expr\Error Parameter variable */
    public Expr $var;
    
    /** @var null|Expr Default value */
    public ?Expr $default;
    
    /** @var int Optional visibility flags */
    public int $flags;
    
    /** @var AttributeGroup[] PHP attribute groups */
    public array $attrGroups;
    
    /** @var PropertyHook[] Property hooks for promoted properties */
    public array $hooks;
    
    /**
     * Constructs a parameter node.
     *
     * @param Expr\Variable|Expr\Error $var Parameter variable
     * @param null|Expr $default Default value
     * @param null|Identifier|Name|ComplexType $type Type declaration
     * @param bool $byRef Whether is passed by reference
     * @param bool $variadic Whether this is a variadic argument
     * @param array<string, mixed> $attributes Additional attributes
     * @param int $flags Optional visibility flags
     * @param list<AttributeGroup> $attrGroups PHP attribute groups
     * @param PropertyHook[] $hooks Property hooks for promoted properties
     */
    public function __construct(Expr $var, ?Expr $default = null, ?Node $type = null, bool $byRef = false, bool $variadic = false, array $attributes = [], int $flags = 0, array $attrGroups = [], array $hooks = []) {
        $this->attributes = $attributes;
        $this->type = $type;
        $this->byRef = $byRef;
        $this->variadic = $variadic;
        $this->var = $var;
        $this->default = $default;
        $this->flags = $flags;
        $this->attrGroups = $attrGroups;
        $this->hooks = $hooks;
    }
    public function getSubNodeNames() : array {
        return [
            'attrGroups',
            'flags',
            'type',
            'byRef',
            'variadic',
            'var',
            'default',
            'hooks',
        ];
    }
    public function getType() : string {
        return 'Param';
    }
    
    /**
     * Whether this parameter uses constructor property promotion.
     */
    public function isPromoted() : bool {
        return $this->flags !== 0;
    }
    public function isPublic() : bool {
        return (bool) ($this->flags & Modifiers::PUBLIC);
    }
    public function isProtected() : bool {
        return (bool) ($this->flags & Modifiers::PROTECTED);
    }
    public function isPrivate() : bool {
        return (bool) ($this->flags & Modifiers::PRIVATE);
    }
    public function isReadonly() : bool {
        return (bool) ($this->flags & Modifiers::READONLY);
    }
    
    /**
     * Whether the promoted property has explicit public(set) visibility.
     */
    public function isPublicSet() : bool {
        return (bool) ($this->flags & Modifiers::PUBLIC_SET);
    }
    
    /**
     * Whether the promoted property has explicit protected(set) visibility.
     */
    public function isProtectedSet() : bool {
        return (bool) ($this->flags & Modifiers::PROTECTED_SET);
    }
    
    /**
     * Whether the promoted property has explicit private(set) visibility.
     */
    public function isPrivateSet() : bool {
        return (bool) ($this->flags & Modifiers::PRIVATE_SET);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
NodeAbstract::$attributes protected property @var array&lt;string, mixed&gt; Attributes
NodeAbstract::getAttribute public function Returns the value of an attribute. Overrides Node::getAttribute
NodeAbstract::getAttributes public function Returns all the attributes of this node. Overrides Node::getAttributes
NodeAbstract::getComments public function Gets all comments directly preceding this node. Overrides Node::getComments
NodeAbstract::getDocComment public function Gets the doc comment of the node. Overrides Node::getDocComment
NodeAbstract::getEndFilePos public function Gets the file offset of the last character that is part of this node. Overrides Node::getEndFilePos
NodeAbstract::getEndLine public function Gets the line the node ended in. Overrides Node::getEndLine
NodeAbstract::getEndTokenPos public function Gets the token offset of the last token that is part of this node. Overrides Node::getEndTokenPos
NodeAbstract::getLine public function Gets line the node started in (alias of getStartLine). Overrides Node::getLine
NodeAbstract::getStartFilePos public function Gets the file offset of the first character that is part of this node. Overrides Node::getStartFilePos
NodeAbstract::getStartLine public function Gets line the node started in. Overrides Node::getStartLine
NodeAbstract::getStartTokenPos public function Gets the token offset of the first token that is part of this node. Overrides Node::getStartTokenPos
NodeAbstract::hasAttribute public function Returns whether an attribute exists. Overrides Node::hasAttribute
NodeAbstract::jsonSerialize public function
NodeAbstract::setAttribute public function Sets an attribute on a node. Overrides Node::setAttribute
NodeAbstract::setAttributes public function Replaces all the attributes of this node. Overrides Node::setAttributes
NodeAbstract::setDocComment public function Sets the doc comment of the node. Overrides Node::setDocComment
Param::$attrGroups public property @var AttributeGroup[] PHP attribute groups
Param::$byRef public property @var bool Whether parameter is passed by reference
Param::$default public property @var null|Expr Default value
Param::$flags public property @var int Optional visibility flags
Param::$hooks public property @var PropertyHook[] Property hooks for promoted properties
Param::$type public property @var null|Identifier|Name|ComplexType Type declaration
Param::$var public property @var Expr\Variable|Expr\Error Parameter variable
Param::$variadic public property @var bool Whether this is a variadic argument
Param::getSubNodeNames public function Gets the names of the sub nodes. Overrides Node::getSubNodeNames
Param::getType public function Gets the type of the node. Overrides Node::getType
Param::isPrivate public function
Param::isPrivateSet public function Whether the promoted property has explicit private(set) visibility.
Param::isPromoted public function Whether this parameter uses constructor property promotion.
Param::isProtected public function
Param::isProtectedSet public function Whether the promoted property has explicit protected(set) visibility.
Param::isPublic public function
Param::isPublicSet public function Whether the promoted property has explicit public(set) visibility.
Param::isReadonly public function
Param::__construct public function Constructs a parameter node. Overrides NodeAbstract::__construct

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal