code
stringlengths
31
1.39M
docstring
stringlengths
23
16.8k
func_name
stringlengths
1
126
language
stringclasses
1 value
repo
stringlengths
7
63
path
stringlengths
7
166
url
stringlengths
50
220
license
stringclasses
7 values
public function getLast() : string { if (\false !== ($pos = \strrpos($this->name, '\\'))) { return \substr($this->name, $pos + 1); } return $this->name; }
Gets the last part of the name, i.e. everything after the last namespace separator. @return string Last part of the name
getLast
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function isUnqualified() : bool { return \false === \strpos($this->name, '\\'); }
Checks whether the name is unqualified. (E.g. Name) @return bool Whether the name is unqualified
isUnqualified
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function isQualified() : bool { return \false !== \strpos($this->name, '\\'); }
Checks whether the name is qualified. (E.g. Name\Name) @return bool Whether the name is qualified
isQualified
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function isFullyQualified() : bool { return \false; }
Checks whether the name is fully qualified. (E.g. \Name) @return bool Whether the name is fully qualified
isFullyQualified
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function isRelative() : bool { return \false; }
Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) @return bool Whether the name is relative
isRelative
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function toString() : string { return $this->name; }
Returns a string representation of the name itself, without taking the name type into account (e.g., not including a leading backslash for fully qualified names). @psalm-return non-empty-string @return string String representation
toString
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function toCodeString() : string { return $this->toString(); }
Returns a string representation of the name as it would occur in code (e.g., including leading backslash for fully qualified names. @psalm-return non-empty-string @return string String representation
toCodeString
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function toLowerString() : string { return \strtolower($this->name); }
Returns lowercased string representation of the name, without taking the name type into account (e.g., no leading backslash for fully qualified names). @psalm-return non-empty-string&lowercase-string @return string Lowercased string representation
toLowerString
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function isSpecialClassName() : bool { return isset(self::$specialClassNames[\strtolower($this->name)]); }
Checks whether the identifier is a special class name (self, parent or static). @return bool Whether identifier is a special class name
isSpecialClassName
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function __toString() : string { return $this->name; }
Returns a string representation of the name by imploding the namespace parts with the namespace separator. @psalm-return non-empty-string @return string String representation
__toString
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function slice(int $offset, ?int $length = null) { if ($offset === 1 && $length === null) { // Short-circuit the common case. if (\false !== ($pos = \strpos($this->name, '\\'))) { return new static(\substr($this->name, $pos + 1)); } return null; } $parts = \explode('\\', $this->name); $numParts = \count($parts); $realOffset = $offset < 0 ? $offset + $numParts : $offset; if ($realOffset < 0 || $realOffset > $numParts) { throw new \OutOfBoundsException(\sprintf('Offset %d is out of bounds', $offset)); } if (null === $length) { $realLength = $numParts - $realOffset; } else { $realLength = $length < 0 ? $length + $numParts - $realOffset : $length; if ($realLength < 0 || $realLength > $numParts - $realOffset) { throw new \OutOfBoundsException(\sprintf('Length %d is out of bounds', $length)); } } if ($realLength === 0) { // Empty slice is represented as null return null; } return new static(\array_slice($parts, $realOffset, $realLength), $this->attributes); }
Gets a slice of a name (similar to array_slice). This method returns a new instance of the same type as the original and with the same attributes. If the slice is empty, null is returned. The null value will be correctly handled in concatenations using concat(). Offset and length have the same meaning as in array_slice(). @param int $offset Offset to start the slice at (may be negative) @param int|null $length Length of the slice (may be negative) @return static|null Sliced name
slice
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public static function concat($name1, $name2, array $attributes = []) { if (null === $name1 && null === $name2) { return null; } if (null === $name1) { return new static($name2, $attributes); } if (null === $name2) { return new static($name1, $attributes); } else { return new static(self::prepareName($name1) . '\\' . self::prepareName($name2), $attributes); } }
Concatenate two names, yielding a new Name instance. The type of the generated instance depends on which class this method is called on, for example Name\FullyQualified::concat() will yield a Name\FullyQualified instance. If one of the arguments is null, a new instance of the other name will be returned. If both arguments are null, null will be returned. As such, writing Name::concat($namespace, $shortName) where $namespace is a Name node or null will work as expected. @param string|string[]|self|null $name1 The first name @param string|string[]|self|null $name2 The second name @param array<string, mixed> $attributes Attributes to assign to concatenated name @return static|null Concatenated name
concat
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
private static function prepareName($name) : string { if (\is_string($name)) { if ('' === $name) { throw new \InvalidArgumentException('Name cannot be empty'); } return $name; } if (\is_array($name)) { if (empty($name)) { throw new \InvalidArgumentException('Name cannot be empty'); } return \implode('\\', $name); } if ($name instanceof self) { return $name->name; } throw new \InvalidArgumentException('Expected string, array of parts or Name instance'); }
Prepares a (string, array or Name node) name for use in name changing methods by converting it to a string. @param string|string[]|self $name Name to prepare @psalm-return non-empty-string @return string Prepared name
prepareName
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php
MIT
public function __construct(Node $type, array $attributes = []) { $this->attributes = $attributes; $this->type = $type; }
Constructs a nullable type (wrapping another type). @param Identifier|Name $type Type @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php
MIT
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; }
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
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
MIT
public function isPromoted() : bool { return $this->flags !== 0 || $this->hooks !== []; }
Whether this parameter uses constructor property promotion.
isPromoted
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
MIT
public function isPublicSet() : bool { return (bool) ($this->flags & Modifiers::PUBLIC_SET); }
Whether the promoted property has explicit public(set) visibility.
isPublicSet
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
MIT
public function isProtectedSet() : bool { return (bool) ($this->flags & Modifiers::PROTECTED_SET); }
Whether the promoted property has explicit protected(set) visibility.
isProtectedSet
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
MIT
public function isPrivateSet() : bool { return (bool) ($this->flags & Modifiers::PRIVATE_SET); }
Whether the promoted property has explicit private(set) visibility.
isPrivateSet
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php
MIT
public function __construct($name, $body, array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; $this->name = \is_string($name) ? new Identifier($name) : $name; $this->body = $body; $this->flags = $subNodes['flags'] ?? 0; $this->byRef = $subNodes['byRef'] ?? \false; $this->params = $subNodes['params'] ?? []; $this->attrGroups = $subNodes['attrGroups'] ?? []; }
Constructs a property hook node. @param string|Identifier $name Hook name @param null|Expr|Stmt[] $body Hook body @param array{ flags?: int, byRef?: bool, params?: Param[], attrGroups?: AttributeGroup[], } $subNodes Array of the following optional subnodes: 'flags => 0 : Flags 'byRef' => false : Whether hook returns by reference 'params' => array(): Parameters 'attrGroups' => array(): PHP attribute groups @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php
MIT
public function isFinal() : bool { return (bool) ($this->flags & Modifiers::FINAL); }
Whether the property hook is final.
isFinal
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php
MIT
public function __construct($name, ?Node\Expr $default = null, array $attributes = []) { $this->attributes = $attributes; $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name; $this->default = $default; }
Constructs a class property item node. @param string|Node\VarLikeIdentifier $name Name @param null|Node\Expr $default Default value @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php
MIT
public function __construct(Expr\Variable $var, ?Node\Expr $default = null, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->default = $default; }
Constructs a static variable node. @param Expr\Variable $var Name @param null|Node\Expr $default Default value @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php
MIT
public function __construct(array $types, array $attributes = []) { $this->attributes = $attributes; $this->types = $types; }
Constructs a union type. @param (Identifier|Name|IntersectionType)[] $types Types @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php
MIT
public function __construct(Node\Name $name, $alias = null, int $type = Use_::TYPE_UNKNOWN, array $attributes = []) { $this->attributes = $attributes; $this->type = $type; $this->name = $name; $this->alias = \is_string($alias) ? new Identifier($alias) : $alias; }
Constructs an alias (use) item node. @param Node\Name $name Namespace/Class to alias @param null|string|Identifier $alias Alias @param Use_::TYPE_* $type Type of the use element (for mixed group use only) @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php
MIT
public function getAlias() : Identifier { if (null !== $this->alias) { return $this->alias; } return new Identifier($this->name->getLast()); }
Get alias. If not explicitly given this is the last component of the used name.
getAlias
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php
MIT
public function __construct(array $attributes = []) { $this->attributes = $attributes; }
Create a variadic argument placeholder (first-class callable syntax). @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php
MIT
public function __construct(Expr $var, ?Expr $dim = null, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->dim = $dim; }
Constructs an array index fetch node. @param Expr $var Variable @param null|Expr $dim Array index / dim @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php
MIT
public function __construct(array $items = [], array $attributes = []) { $this->attributes = $attributes; $this->items = $items; }
Constructs an array node. @param ArrayItem[] $items Items of the array @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php
MIT
public function __construct(array $subNodes, array $attributes = []) { $this->attributes = $attributes; $this->static = $subNodes['static'] ?? \false; $this->byRef = $subNodes['byRef'] ?? \false; $this->params = $subNodes['params'] ?? []; $this->returnType = $subNodes['returnType'] ?? null; $this->expr = $subNodes['expr']; $this->attrGroups = $subNodes['attrGroups'] ?? []; }
@param array{ expr: Expr, static?: bool, byRef?: bool, params?: Node\Param[], returnType?: null|Node\Identifier|Node\Name|Node\ComplexType, attrGroups?: Node\AttributeGroup[] } $subNodes Array of the following subnodes: 'expr' : Expression body 'static' => false : Whether the closure is static 'byRef' => false : Whether to return by reference 'params' => array() : Parameters 'returnType' => null : Return type 'attrGroups' => array() : PHP attribute groups @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php
MIT
public function __construct(Expr $var, Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->expr = $expr; }
Constructs an assignment node. @param Expr $var Variable @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php
MIT
public function __construct(Expr $var, Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->expr = $expr; }
Constructs a compound assignment operation node. @param Expr $var Variable @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php
MIT
public function __construct(Expr $var, Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->expr = $expr; }
Constructs an assignment node. @param Expr $var Variable @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php
MIT
public function __construct(Expr $left, Expr $right, array $attributes = []) { $this->attributes = $attributes; $this->left = $left; $this->right = $right; }
Constructs a binary operator node. @param Expr $left The left hand side expression @param Expr $right The right hand side expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs a bitwise not node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs a boolean not node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php
MIT
public function isFirstClassCallable() : bool { $rawArgs = $this->getRawArgs(); return \count($rawArgs) === 1 && \current($rawArgs) instanceof VariadicPlaceholder; }
Returns whether this call expression is actually a first class callable.
isFirstClassCallable
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php
MIT
public function getArgs() : array { \assert(!$this->isFirstClassCallable()); return $this->getRawArgs(); }
Assert that this is not a first-class callable and return only ordinary Args. @return Arg[]
getArgs
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs a cast node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php
MIT
public function __construct(Node $class, $name, array $attributes = []) { $this->attributes = $attributes; $this->class = $class; $this->name = \is_string($name) ? new Identifier($name) : $name; }
Constructs a class const fetch node. @param Name|Expr $class Class name @param string|Identifier|Expr|Error $name Constant name @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs a clone node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php
MIT
public function __construct(array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; $this->static = $subNodes['static'] ?? \false; $this->byRef = $subNodes['byRef'] ?? \false; $this->params = $subNodes['params'] ?? []; $this->uses = $subNodes['uses'] ?? []; $this->returnType = $subNodes['returnType'] ?? null; $this->stmts = $subNodes['stmts'] ?? []; $this->attrGroups = $subNodes['attrGroups'] ?? []; }
Constructs a lambda function node. @param array{ static?: bool, byRef?: bool, params?: Node\Param[], uses?: ClosureUse[], returnType?: null|Node\Identifier|Node\Name|Node\ComplexType, stmts?: Node\Stmt[], attrGroups?: Node\AttributeGroup[], } $subNodes Array of the following optional subnodes: 'static' => false : Whether the closure is static 'byRef' => false : Whether to return by reference 'params' => array(): Parameters 'uses' => array(): use()s 'returnType' => null : Return type 'stmts' => array(): Statements 'attrGroups' => array(): PHP attributes groups @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php
MIT
public function __construct(Name $name, array $attributes = []) { $this->attributes = $attributes; $this->name = $name; }
Constructs a const fetch node. @param Name $name Constant name @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs an empty() node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php
MIT
public function __construct(array $attributes = []) { $this->attributes = $attributes; }
Constructs an error node. @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs an error suppress node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs an eval() node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php
MIT
public function __construct(?Expr $expr = null, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs an exit() node. @param null|Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php
MIT
public function __construct(Node $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; $this->name = $name; $this->args = $args; }
Constructs a function call node. @param Node\Name|Expr $name Function name @param array<Node\Arg|Node\VariadicPlaceholder> $args Arguments @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php
MIT
public function __construct(Expr $expr, int $type, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; $this->type = $type; }
Constructs an include node. @param Expr $expr Expression @param int $type Type of include @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php
MIT
public function __construct(Expr $expr, Node $class, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; $this->class = $class; }
Constructs an instanceof check node. @param Expr $expr Expression @param Name|Expr $class Class name @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php
MIT
public function __construct(array $vars, array $attributes = []) { $this->attributes = $attributes; $this->vars = $vars; }
Constructs an array node. @param Expr[] $vars Variables @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php
MIT
public function __construct(array $items, array $attributes = []) { $this->attributes = $attributes; $this->items = $items; }
Constructs a list() destructuring node. @param (ArrayItem|null)[] $items List of items to assign to @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php
MIT
public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) { $this->attributes = $attributes; $this->cond = $cond; $this->arms = $arms; }
@param Node\Expr $cond Condition @param MatchArm[] $arms @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php
MIT
public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->name = \is_string($name) ? new Identifier($name) : $name; $this->args = $args; }
Constructs a function call node. @param Expr $var Variable holding object @param string|Identifier|Expr $name Method name @param array<Arg|VariadicPlaceholder> $args Arguments @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php
MIT
public function __construct(Node $class, array $args = [], array $attributes = []) { $this->attributes = $attributes; $this->class = $class; $this->args = $args; }
Constructs a function call node. @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes) @param array<Arg|VariadicPlaceholder> $args Arguments @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php
MIT
public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->name = \is_string($name) ? new Identifier($name) : $name; $this->args = $args; }
Constructs a nullsafe method call node. @param Expr $var Variable holding object @param string|Identifier|Expr $name Method name @param array<Arg|VariadicPlaceholder> $args Arguments @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php
MIT
public function __construct(Expr $var, $name, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->name = \is_string($name) ? new Identifier($name) : $name; }
Constructs a nullsafe property fetch node. @param Expr $var Variable holding object @param string|Identifier|Expr $name Property name @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php
MIT
public function __construct(Expr $var, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; }
Constructs a post decrement node. @param Expr $var Variable @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php
MIT
public function __construct(Expr $var, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; }
Constructs a post increment node. @param Expr $var Variable @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php
MIT
public function __construct(Expr $var, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; }
Constructs a pre decrement node. @param Expr $var Variable @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php
MIT
public function __construct(Expr $var, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; }
Constructs a pre increment node. @param Expr $var Variable @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs an print() node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php
MIT
public function __construct(Expr $var, $name, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->name = \is_string($name) ? new Identifier($name) : $name; }
Constructs a function call node. @param Expr $var Variable holding object @param string|Identifier|Expr $name Property name @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php
MIT
public function __construct(array $parts, array $attributes = []) { $this->attributes = $attributes; $this->parts = $parts; }
Constructs a shell exec (backtick) node. @param (Expr|InterpolatedStringPart)[] $parts Interpolated string array @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php
MIT
public function __construct(Node $class, $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; $this->class = $class; $this->name = \is_string($name) ? new Identifier($name) : $name; $this->args = $args; }
Constructs a static method call node. @param Node\Name|Expr $class Class name @param string|Identifier|Expr $name Method name @param array<Arg|VariadicPlaceholder> $args Arguments @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php
MIT
public function __construct(Node $class, $name, array $attributes = []) { $this->attributes = $attributes; $this->class = $class; $this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name; }
Constructs a static property fetch node. @param Name|Expr $class Class name @param string|VarLikeIdentifier|Expr $name Property name @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php
MIT
public function __construct(Expr $cond, ?Expr $if, Expr $else, array $attributes = []) { $this->attributes = $attributes; $this->cond = $cond; $this->if = $if; $this->else = $else; }
Constructs a ternary operator node. @param Expr $cond Condition @param null|Expr $if Expression for true @param Expr $else Expression for false @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php
MIT
public function __construct(Node\Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs a throw expression node. @param Node\Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs a unary minus node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs a unary plus node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php
MIT
public function __construct($name, array $attributes = []) { $this->attributes = $attributes; $this->name = $name; }
Constructs a variable node. @param string|Expr $name Name @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php
MIT
public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; }
Constructs an "yield from" node. @param Expr $expr Expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php
MIT
public function __construct(?Expr $value = null, ?Expr $key = null, array $attributes = []) { $this->attributes = $attributes; $this->key = $key; $this->value = $value; }
Constructs a yield expression node. @param null|Expr $value Value expression @param null|Expr $key Key expression @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php
MIT
public function isUnqualified() : bool { return \false; }
Checks whether the name is unqualified. (E.g. Name) @return bool Whether the name is unqualified
isUnqualified
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php
MIT
public function isQualified() : bool { return \false; }
Checks whether the name is qualified. (E.g. Name\Name) @return bool Whether the name is qualified
isQualified
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php
MIT
public function isFullyQualified() : bool { return \true; }
Checks whether the name is fully qualified. (E.g. \Name) @return bool Whether the name is fully qualified
isFullyQualified
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php
MIT
public function isRelative() : bool { return \false; }
Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) @return bool Whether the name is relative
isRelative
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php
MIT
public function isUnqualified() : bool { return \false; }
Checks whether the name is unqualified. (E.g. Name) @return bool Whether the name is unqualified
isUnqualified
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php
MIT
public function isQualified() : bool { return \false; }
Checks whether the name is qualified. (E.g. Name\Name) @return bool Whether the name is qualified
isQualified
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php
MIT
public function isFullyQualified() : bool { return \false; }
Checks whether the name is fully qualified. (E.g. \Name) @return bool Whether the name is fully qualified
isFullyQualified
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php
MIT
public function isRelative() : bool { return \true; }
Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) @return bool Whether the name is relative
isRelative
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php
MIT
public function __construct(float $value, array $attributes = []) { $this->attributes = $attributes; $this->value = $value; }
Constructs a float number scalar node. @param float $value Value of the number @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php
MIT
public static function parse(string $str) : float { $str = \str_replace('_', '', $str); // Check whether this is one of the special integer notations. if ('0' === $str[0]) { // hex if ('x' === $str[1] || 'X' === $str[1]) { return \hexdec($str); } // bin if ('b' === $str[1] || 'B' === $str[1]) { return \bindec($str); } // oct, but only if the string does not contain any of '.eE'. if (\false === \strpbrk($str, '.eE')) { // substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit // (8 or 9) so that only the digits before that are used. return \octdec(\substr($str, 0, \strcspn($str, '89'))); } } // dec return (float) $str; }
@internal Parses a DNUMBER token like PHP would. @param string $str A string number @return float The parsed number
parse
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php
MIT
public function __construct(array $parts, array $attributes = []) { $this->attributes = $attributes; $this->parts = $parts; }
Constructs an interpolated string node. @param (Expr|InterpolatedStringPart)[] $parts Interpolated string parts @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php
MIT
public function __construct(int $value, array $attributes = []) { $this->attributes = $attributes; $this->value = $value; }
Constructs an integer number scalar node. @param int $value Value of the number @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php
MIT
public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = \false) : Int_ { $attributes['rawValue'] = $str; $str = \str_replace('_', '', $str); if ('0' !== $str[0] || '0' === $str) { $attributes['kind'] = Int_::KIND_DEC; return new Int_((int) $str, $attributes); } if ('x' === $str[1] || 'X' === $str[1]) { $attributes['kind'] = Int_::KIND_HEX; return new Int_(\hexdec($str), $attributes); } if ('b' === $str[1] || 'B' === $str[1]) { $attributes['kind'] = Int_::KIND_BIN; return new Int_(\bindec($str), $attributes); } if (!$allowInvalidOctal && \strpbrk($str, '89')) { throw new Error('Invalid numeric literal', $attributes); } // Strip optional explicit octal prefix. if ('o' === $str[1] || 'O' === $str[1]) { $str = \substr($str, 2); } // use intval instead of octdec to get proper cutting behavior with malformed numbers $attributes['kind'] = Int_::KIND_OCT; return new Int_(\intval($str, 8), $attributes); }
Constructs an Int node from a string number literal. @param string $str String number literal (decimal, octal, hex or binary) @param array<string, mixed> $attributes Additional attributes @param bool $allowInvalidOctal Whether to allow invalid octal numbers (PHP 5) @return Int_ The constructed LNumber, including kind attribute
fromString
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php
MIT
public function __construct(array $attributes = []) { $this->attributes = $attributes; }
Constructs a magic constant node. @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php
MIT
public function __construct(string $value, array $attributes = []) { $this->attributes = $attributes; $this->value = $value; }
Constructs a string scalar node. @param string $value Value of the string @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php
MIT
public static function fromString(string $str, array $attributes = [], bool $parseUnicodeEscape = \true) : self { $attributes['kind'] = $str[0] === "'" || $str[1] === "'" && ($str[0] === 'b' || $str[0] === 'B') ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED; $attributes['rawValue'] = $str; $string = self::parse($str, $parseUnicodeEscape); return new self($string, $attributes); }
@param array<string, mixed> $attributes @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes
fromString
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php
MIT
public static function parse(string $str, bool $parseUnicodeEscape = \true) : string { $bLength = 0; if ('b' === $str[0] || 'B' === $str[0]) { $bLength = 1; } if ('\'' === $str[$bLength]) { return \str_replace(['\\\\', '\\\''], ['\\', '\''], \substr($str, $bLength + 1, -1)); } else { return self::parseEscapeSequences(\substr($str, $bLength + 1, -1), '"', $parseUnicodeEscape); } }
@internal Parses a string token. @param string $str String token content @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes @return string The parsed string
parse
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php
MIT
public static function parseEscapeSequences(string $str, ?string $quote, bool $parseUnicodeEscape = \true) : string { if (null !== $quote) { $str = \str_replace('\\' . $quote, $quote, $str); } $extra = ''; if ($parseUnicodeEscape) { $extra = '|u\\{([0-9a-fA-F]+)\\}'; } return \preg_replace_callback('~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}' . $extra . ')~', function ($matches) { $str = $matches[1]; if (isset(self::$replacements[$str])) { return self::$replacements[$str]; } if ('x' === $str[0] || 'X' === $str[0]) { return \chr(\hexdec(\substr($str, 1))); } if ('u' === $str[0]) { $dec = \hexdec($matches[2]); // If it overflowed to float, treat as INT_MAX, it will throw an error anyway. return self::codePointToUtf8(\is_int($dec) ? $dec : \PHP_INT_MAX); } else { return \chr(\octdec($str)); } }, $str); }
@internal Parses escape sequences in strings (all string types apart from single quoted). @param string $str String without quotes @param null|string $quote Quote type @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes @return string String with escape sequences parsed
parseEscapeSequences
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php
MIT
private static function codePointToUtf8(int $num) : string { if ($num <= 0x7f) { return \chr($num); } if ($num <= 0x7ff) { return \chr(($num >> 6) + 0xc0) . \chr(($num & 0x3f) + 0x80); } if ($num <= 0xffff) { return \chr(($num >> 12) + 0xe0) . \chr(($num >> 6 & 0x3f) + 0x80) . \chr(($num & 0x3f) + 0x80); } if ($num <= 0x1fffff) { return \chr(($num >> 18) + 0xf0) . \chr(($num >> 12 & 0x3f) + 0x80) . \chr(($num >> 6 & 0x3f) + 0x80) . \chr(($num & 0x3f) + 0x80); } throw new Error('Invalid UTF-8 codepoint escape sequence: Codepoint too large'); }
Converts a Unicode code point to its UTF-8 encoded representation. @param int $num Code point @return string UTF-8 representation of code point
codePointToUtf8
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php
MIT
public function __construct(array $stmts, array $attributes = []) { $this->attributes = $attributes; $this->stmts = $stmts; }
A block of statements. @param Stmt[] $stmts Statements @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php
MIT
public function __construct(?Node\Expr $num = null, array $attributes = []) { $this->attributes = $attributes; $this->num = $num; }
Constructs a break node. @param null|Node\Expr $num Number of loops to break @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php
MIT
public function __construct(?Node\Expr $cond, array $stmts = [], array $attributes = []) { $this->attributes = $attributes; $this->cond = $cond; $this->stmts = $stmts; }
Constructs a case node. @param null|Node\Expr $cond Condition (null for default) @param Node\Stmt[] $stmts Statements @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php
MIT
public function __construct(array $types, ?Expr\Variable $var = null, array $stmts = [], array $attributes = []) { $this->attributes = $attributes; $this->types = $types; $this->var = $var; $this->stmts = $stmts; }
Constructs a catch node. @param Node\Name[] $types Types of exceptions to catch @param Expr\Variable|null $var Variable for exception @param Node\Stmt[] $stmts Statements @param array<string, mixed> $attributes Additional attributes
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php
MIT
public function __construct(array $consts, int $flags = 0, array $attributes = [], array $attrGroups = [], ?Node $type = null) { $this->attributes = $attributes; $this->flags = $flags; $this->consts = $consts; $this->attrGroups = $attrGroups; $this->type = $type; }
Constructs a class const list node. @param Node\Const_[] $consts Constant declarations @param int $flags Modifiers @param array<string, mixed> $attributes Additional attributes @param list<Node\AttributeGroup> $attrGroups PHP attribute groups @param null|Node\Identifier|Node\Name|Node\ComplexType $type Type declaration
__construct
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php
MIT
public function isPublic() : bool { return ($this->flags & Modifiers::PUBLIC) !== 0 || ($this->flags & Modifiers::VISIBILITY_MASK) === 0; }
Whether constant is explicitly or implicitly public.
isPublic
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php
MIT
public function getProperty(string $name) : ?Property { foreach ($this->stmts as $stmt) { if ($stmt instanceof Property) { foreach ($stmt->props as $prop) { if ($prop instanceof PropertyItem && $name === $prop->name->toString()) { return $stmt; } } } } return null; }
Gets property with the given name defined directly in this class/interface/trait. @param string $name Name of the property @return Property|null Property node or null if the property does not exist
getProperty
php
deptrac/deptrac
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php
MIT