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 getMethods() : array
{
$methods = [];
foreach ($this->stmts as $stmt) {
if ($stmt instanceof ClassMethod) {
$methods[] = $stmt;
}
}
return $methods;
}
|
Gets all methods defined directly in this class/interface/trait
@return ClassMethod[]
|
getMethods
|
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
|
public function getMethod(string $name) : ?ClassMethod
{
$lowerName = \strtolower($name);
foreach ($this->stmts as $stmt) {
if ($stmt instanceof ClassMethod && $lowerName === $stmt->name->toLowerString()) {
return $stmt;
}
}
return null;
}
|
Gets method with the given name defined directly in this class/interface/trait.
@param string $name Name of the method (compared case-insensitively)
@return ClassMethod|null Method node or null if the method does not exist
|
getMethod
|
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
|
public function __construct($name, array $subNodes = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0;
$this->byRef = $subNodes['byRef'] ?? \false;
$this->name = \is_string($name) ? new Node\Identifier($name) : $name;
$this->params = $subNodes['params'] ?? [];
$this->returnType = $subNodes['returnType'] ?? null;
$this->stmts = \array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : [];
$this->attrGroups = $subNodes['attrGroups'] ?? [];
}
|
Constructs a class method node.
@param string|Node\Identifier $name Name
@param array{
flags?: int,
byRef?: bool,
params?: Node\Param[],
returnType?: null|Node\Identifier|Node\Name|Node\ComplexType,
stmts?: Node\Stmt[]|null,
attrGroups?: Node\AttributeGroup[],
} $subNodes Array of the following optional subnodes:
'flags => 0 : Flags
'byRef' => false : Whether to return by reference
'params' => array() : Parameters
'returnType' => null : Return type
'stmts' => array() : Statements
'attrGroups' => array() : PHP attribute groups
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php
|
MIT
|
public function isPublic() : bool
{
return ($this->flags & Modifiers::PUBLIC) !== 0 || ($this->flags & Modifiers::VISIBILITY_MASK) === 0;
}
|
Whether the method is explicitly or implicitly public.
|
isPublic
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php
|
MIT
|
public function __construct($name, array $subNodes = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0;
$this->name = \is_string($name) ? new Node\Identifier($name) : $name;
$this->extends = $subNodes['extends'] ?? null;
$this->implements = $subNodes['implements'] ?? [];
$this->stmts = $subNodes['stmts'] ?? [];
$this->attrGroups = $subNodes['attrGroups'] ?? [];
}
|
Constructs a class node.
@param string|Node\Identifier|null $name Name
@param array{
flags?: int,
extends?: Node\Name|null,
implements?: Node\Name[],
stmts?: Node\Stmt[],
attrGroups?: Node\AttributeGroup[],
} $subNodes Array of the following optional subnodes:
'flags' => 0 : Flags
'extends' => null : Name of extended class
'implements' => array(): Names of implemented interfaces
'stmts' => array(): Statements
'attrGroups' => array(): PHP attribute groups
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php
|
MIT
|
public function isAbstract() : bool
{
return (bool) ($this->flags & Modifiers::ABSTRACT);
}
|
Whether the class is explicitly abstract.
|
isAbstract
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php
|
MIT
|
public function __construct(array $consts, array $attributes = [])
{
$this->attributes = $attributes;
$this->consts = $consts;
}
|
Constructs a const list node.
@param Node\Const_[] $consts Constant declarations
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php
|
MIT
|
public function __construct(?Node\Expr $num = null, array $attributes = [])
{
$this->attributes = $attributes;
$this->num = $num;
}
|
Constructs a continue node.
@param null|Node\Expr $num Number of loops to continue
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php
|
MIT
|
public function __construct(array $declares, ?array $stmts = null, array $attributes = [])
{
$this->attributes = $attributes;
$this->declares = $declares;
$this->stmts = $stmts;
}
|
Constructs a declare node.
@param DeclareItem[] $declares List of declares
@param Node\Stmt[]|null $stmts Statements
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php
|
MIT
|
public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->cond = $cond;
$this->stmts = $stmts;
}
|
Constructs a do while node.
@param Node\Expr $cond Condition
@param Node\Stmt[] $stmts Statements
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php
|
MIT
|
public function __construct(array $exprs, array $attributes = [])
{
$this->attributes = $attributes;
$this->exprs = $exprs;
}
|
Constructs an echo node.
@param Node\Expr[] $exprs Expressions
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php
|
MIT
|
public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->cond = $cond;
$this->stmts = $stmts;
}
|
Constructs an elseif node.
@param Node\Expr $cond Condition
@param Node\Stmt[] $stmts Statements
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php
|
MIT
|
public function __construct(array $stmts = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->stmts = $stmts;
}
|
Constructs an else node.
@param Node\Stmt[] $stmts Statements
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php
|
MIT
|
public function __construct($name, ?Node\Expr $expr = null, array $attrGroups = [], array $attributes = [])
{
parent::__construct($attributes);
$this->name = \is_string($name) ? new Node\Identifier($name) : $name;
$this->expr = $expr;
$this->attrGroups = $attrGroups;
}
|
@param string|Node\Identifier $name Enum case name
@param Node\Expr|null $expr Enum case expression
@param list<AttributeGroup> $attrGroups PHP attribute groups
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php
|
MIT
|
public function __construct($name, array $subNodes = [], array $attributes = [])
{
$this->name = \is_string($name) ? new Node\Identifier($name) : $name;
$this->scalarType = $subNodes['scalarType'] ?? null;
$this->implements = $subNodes['implements'] ?? [];
$this->stmts = $subNodes['stmts'] ?? [];
$this->attrGroups = $subNodes['attrGroups'] ?? [];
parent::__construct($attributes);
}
|
@param string|Node\Identifier|null $name Name
@param array{
scalarType?: Node\Identifier|null,
implements?: Node\Name[],
stmts?: Node\Stmt[],
attrGroups?: Node\AttributeGroup[],
} $subNodes Array of the following optional subnodes:
'scalarType' => null : Scalar type
'implements' => array() : Names of implemented interfaces
'stmts' => array() : Statements
'attrGroups' => array() : PHP attribute groups
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php
|
MIT
|
public function __construct(Node\Expr $expr, array $attributes = [])
{
$this->attributes = $attributes;
$this->expr = $expr;
}
|
Constructs an expression statement.
@param Node\Expr $expr Expression
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php
|
MIT
|
public function __construct(array $stmts = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->stmts = $stmts;
}
|
Constructs a finally node.
@param Node\Stmt[] $stmts Statements
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php
|
MIT
|
public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->expr = $expr;
$this->keyVar = $subNodes['keyVar'] ?? null;
$this->byRef = $subNodes['byRef'] ?? \false;
$this->valueVar = $valueVar;
$this->stmts = $subNodes['stmts'] ?? [];
}
|
Constructs a foreach node.
@param Node\Expr $expr Expression to iterate
@param Node\Expr $valueVar Variable to assign value to
@param array{
keyVar?: Node\Expr|null,
byRef?: bool,
stmts?: Node\Stmt[],
} $subNodes Array of the following optional subnodes:
'keyVar' => null : Variable to assign key to
'byRef' => false : Whether to assign value by reference
'stmts' => array(): Statements
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php
|
MIT
|
public function __construct(array $subNodes = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->init = $subNodes['init'] ?? [];
$this->cond = $subNodes['cond'] ?? [];
$this->loop = $subNodes['loop'] ?? [];
$this->stmts = $subNodes['stmts'] ?? [];
}
|
Constructs a for loop node.
@param array{
init?: Node\Expr[],
cond?: Node\Expr[],
loop?: Node\Expr[],
stmts?: Node\Stmt[],
} $subNodes Array of the following optional subnodes:
'init' => array(): Init expressions
'cond' => array(): Loop conditions
'loop' => array(): Loop expressions
'stmts' => array(): Statements
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php
|
MIT
|
public function __construct($name, array $subNodes = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->byRef = $subNodes['byRef'] ?? \false;
$this->name = \is_string($name) ? new Node\Identifier($name) : $name;
$this->params = $subNodes['params'] ?? [];
$this->returnType = $subNodes['returnType'] ?? null;
$this->stmts = $subNodes['stmts'] ?? [];
$this->attrGroups = $subNodes['attrGroups'] ?? [];
}
|
Constructs a function node.
@param string|Node\Identifier $name Name
@param array{
byRef?: bool,
params?: Node\Param[],
returnType?: null|Node\Identifier|Node\Name|Node\ComplexType,
stmts?: Node\Stmt[],
attrGroups?: Node\AttributeGroup[],
} $subNodes Array of the following optional subnodes:
'byRef' => false : Whether to return by reference
'params' => array(): Parameters
'returnType' => null : Return type
'stmts' => array(): Statements
'attrGroups' => array(): PHP attribute groups
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php
|
MIT
|
public function __construct(array $vars, array $attributes = [])
{
$this->attributes = $attributes;
$this->vars = $vars;
}
|
Constructs a global variables list node.
@param Node\Expr[] $vars Variables to unset
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php
|
MIT
|
public function __construct($name, array $attributes = [])
{
$this->attributes = $attributes;
$this->name = \is_string($name) ? new Identifier($name) : $name;
}
|
Constructs a goto node.
@param string|Identifier $name Name of label to jump to
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php
|
MIT
|
public function __construct(Name $prefix, array $uses, int $type = Use_::TYPE_NORMAL, array $attributes = [])
{
$this->attributes = $attributes;
$this->type = $type;
$this->prefix = $prefix;
$this->uses = $uses;
}
|
Constructs a group use node.
@param Name $prefix Prefix for uses
@param UseItem[] $uses Uses
@param Use_::TYPE_* $type Type of group use
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php
|
MIT
|
public function __construct(string $remaining, array $attributes = [])
{
$this->attributes = $attributes;
$this->remaining = $remaining;
}
|
Constructs a __halt_compiler node.
@param string $remaining Remaining text after halt compiler statement.
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php
|
MIT
|
public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->cond = $cond;
$this->stmts = $subNodes['stmts'] ?? [];
$this->elseifs = $subNodes['elseifs'] ?? [];
$this->else = $subNodes['else'] ?? null;
}
|
Constructs an if node.
@param Node\Expr $cond Condition
@param array{
stmts?: Node\Stmt[],
elseifs?: ElseIf_[],
else?: Else_|null,
} $subNodes Array of the following optional subnodes:
'stmts' => array(): Statements
'elseifs' => array(): Elseif clauses
'else' => null : Else clause
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php
|
MIT
|
public function __construct(string $value, array $attributes = [])
{
$this->attributes = $attributes;
$this->value = $value;
}
|
Constructs an inline HTML node.
@param string $value String
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php
|
MIT
|
public function __construct($name, array $subNodes = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->name = \is_string($name) ? new Node\Identifier($name) : $name;
$this->extends = $subNodes['extends'] ?? [];
$this->stmts = $subNodes['stmts'] ?? [];
$this->attrGroups = $subNodes['attrGroups'] ?? [];
}
|
Constructs a class node.
@param string|Node\Identifier $name Name
@param array{
extends?: Node\Name[],
stmts?: Node\Stmt[],
attrGroups?: Node\AttributeGroup[],
} $subNodes Array of the following optional subnodes:
'extends' => array(): Name of extended interfaces
'stmts' => array(): Statements
'attrGroups' => array(): PHP attribute groups
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php
|
MIT
|
public function __construct($name, array $attributes = [])
{
$this->attributes = $attributes;
$this->name = \is_string($name) ? new Identifier($name) : $name;
}
|
Constructs a label node.
@param string|Identifier $name Name
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php
|
MIT
|
public function __construct(?Node\Name $name = null, ?array $stmts = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->name = $name;
$this->stmts = $stmts;
}
|
Constructs a namespace node.
@param null|Node\Name $name Name
@param null|Node\Stmt[] $stmts Statements
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php
|
MIT
|
public function __construct(int $flags, array $props, array $attributes = [], ?Node $type = null, array $attrGroups = [], array $hooks = [])
{
$this->attributes = $attributes;
$this->flags = $flags;
$this->props = $props;
$this->type = $type;
$this->attrGroups = $attrGroups;
$this->hooks = $hooks;
}
|
Constructs a class property list node.
@param int $flags Modifiers
@param PropertyItem[] $props Properties
@param array<string, mixed> $attributes Additional attributes
@param null|Identifier|Name|ComplexType $type Type declaration
@param Node\AttributeGroup[] $attrGroups PHP attribute groups
@param Node\PropertyHook[] $hooks Property hooks
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php
|
MIT
|
public function isPublic() : bool
{
return ($this->flags & Modifiers::PUBLIC) !== 0 || ($this->flags & Modifiers::VISIBILITY_MASK) === 0;
}
|
Whether the property is explicitly or implicitly public.
|
isPublic
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php
|
MIT
|
public function isPublicSet() : bool
{
return (bool) ($this->flags & Modifiers::PUBLIC_SET);
}
|
Whether the property has explicit public(set) visibility.
|
isPublicSet
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php
|
MIT
|
public function isProtectedSet() : bool
{
return (bool) ($this->flags & Modifiers::PROTECTED_SET);
}
|
Whether the property has explicit protected(set) visibility.
|
isProtectedSet
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php
|
MIT
|
public function isPrivateSet() : bool
{
return (bool) ($this->flags & Modifiers::PRIVATE_SET);
}
|
Whether the property has explicit private(set) visibility.
|
isPrivateSet
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php
|
MIT
|
public function __construct(?Node\Expr $expr = null, array $attributes = [])
{
$this->attributes = $attributes;
$this->expr = $expr;
}
|
Constructs a return node.
@param null|Node\Expr $expr Expression
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php
|
MIT
|
public function __construct(array $vars, array $attributes = [])
{
$this->attributes = $attributes;
$this->vars = $vars;
}
|
Constructs a static variables list node.
@param StaticVar[] $vars Variable definitions
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php
|
MIT
|
public function __construct(Node\Expr $cond, array $cases, array $attributes = [])
{
$this->attributes = $attributes;
$this->cond = $cond;
$this->cases = $cases;
}
|
Constructs a case node.
@param Node\Expr $cond Condition
@param Case_[] $cases Case list
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php
|
MIT
|
public function __construct(array $traits, array $adaptations = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->traits = $traits;
$this->adaptations = $adaptations;
}
|
Constructs a trait use node.
@param Node\Name[] $traits Traits
@param TraitUseAdaptation[] $adaptations Adaptations
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php
|
MIT
|
public function __construct($name, array $subNodes = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->name = \is_string($name) ? new Node\Identifier($name) : $name;
$this->stmts = $subNodes['stmts'] ?? [];
$this->attrGroups = $subNodes['attrGroups'] ?? [];
}
|
Constructs a trait node.
@param string|Node\Identifier $name Name
@param array{
stmts?: Node\Stmt[],
attrGroups?: Node\AttributeGroup[],
} $subNodes Array of the following optional subnodes:
'stmts' => array(): Statements
'attrGroups' => array(): PHP attribute groups
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php
|
MIT
|
public function __construct(array $stmts, array $catches, ?Finally_ $finally = null, array $attributes = [])
{
$this->attributes = $attributes;
$this->stmts = $stmts;
$this->catches = $catches;
$this->finally = $finally;
}
|
Constructs a try catch node.
@param Node\Stmt[] $stmts Statements
@param Catch_[] $catches Catches
@param null|Finally_ $finally Optional finally node
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php
|
MIT
|
public function __construct(array $vars, array $attributes = [])
{
$this->attributes = $attributes;
$this->vars = $vars;
}
|
Constructs an unset node.
@param Node\Expr[] $vars Variables to unset
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php
|
MIT
|
public function __construct(array $uses, int $type = self::TYPE_NORMAL, array $attributes = [])
{
$this->attributes = $attributes;
$this->type = $type;
$this->uses = $uses;
}
|
Constructs an alias (use) list node.
@param UseItem[] $uses Aliases
@param Stmt\Use_::TYPE_* $type Type of alias
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php
|
MIT
|
public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = [])
{
$this->attributes = $attributes;
$this->cond = $cond;
$this->stmts = $stmts;
}
|
Constructs a while node.
@param Node\Expr $cond Condition
@param Node\Stmt[] $stmts Statements
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php
|
MIT
|
public function __construct(?Node\Name $trait, $method, ?int $newModifier, $newName, array $attributes = [])
{
$this->attributes = $attributes;
$this->trait = $trait;
$this->method = \is_string($method) ? new Node\Identifier($method) : $method;
$this->newModifier = $newModifier;
$this->newName = \is_string($newName) ? new Node\Identifier($newName) : $newName;
}
|
Constructs a trait use precedence adaptation node.
@param null|Node\Name $trait Trait name
@param string|Node\Identifier $method Method name
@param null|int $newModifier New modifier
@param null|string|Node\Identifier $newName New name
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php
|
MIT
|
public function __construct(Node\Name $trait, $method, array $insteadof, array $attributes = [])
{
$this->attributes = $attributes;
$this->trait = $trait;
$this->method = \is_string($method) ? new Node\Identifier($method) : $method;
$this->insteadof = $insteadof;
}
|
Constructs a trait use precedence adaptation node.
@param Node\Name $trait Trait name
@param string|Node\Identifier $method Method name
@param Node\Name[] $insteadof Overwritten traits
@param array<string, mixed> $attributes Additional attributes
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php
|
MIT
|
public function __construct(array $tokens)
{
$this->tokens = $tokens;
// Collect positions of comments. We use this to avoid traversing parts of the AST where
// there are no comments.
foreach ($tokens as $i => $token) {
if ($token->id === \T_COMMENT || $token->id === \T_DOC_COMMENT) {
$this->commentPositions[] = $i;
}
}
}
|
Create a comment annotation visitor.
@param Token[] $tokens Token array
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php
|
MIT
|
public function getFoundNodes() : array
{
return $this->foundNodes;
}
|
Get found nodes satisfying the filter callback.
Nodes are returned in pre-order.
@return Node[] Found nodes
|
getFoundNodes
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php
|
MIT
|
public function getFoundNode() : ?Node
{
return $this->foundNode;
}
|
Get found node satisfying the filter callback.
Returns null if no node satisfies the filter callback.
@return null|Node Found node (or null if not found)
|
getFoundNode
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php
|
MIT
|
public function __construct(?ErrorHandler $errorHandler = null, array $options = [])
{
$this->nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing());
$this->preserveOriginalNames = $options['preserveOriginalNames'] ?? \false;
$this->replaceNodes = $options['replaceNodes'] ?? \true;
}
|
Constructs a name resolution visitor.
Options:
* preserveOriginalNames (default false): An "originalName" attribute will be added to
all name nodes that underwent resolution.
* replaceNodes (default true): Resolved names are replaced in-place. Otherwise, a
resolvedName attribute is added. (Names that cannot be statically resolved receive a
namespacedName attribute, as usual.)
@param ErrorHandler|null $errorHandler Error handler
@param array{preserveOriginalNames?: bool, replaceNodes?: bool} $options Options
|
__construct
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php
|
MIT
|
private function resolveSignature($node) : void
{
foreach ($node->params as $param) {
$param->type = $this->resolveType($param->type);
$this->resolveAttrGroups($param);
}
$node->returnType = $this->resolveType($node->returnType);
}
|
@param Stmt\Function_|Stmt\ClassMethod|Expr\Closure|Expr\ArrowFunction $node
|
resolveSignature
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php
|
MIT
|
private function resolveType(?Node $node) : ?Node
{
if ($node instanceof Name) {
return $this->resolveClassName($node);
}
if ($node instanceof Node\NullableType) {
$node->type = $this->resolveType($node->type);
return $node;
}
if ($node instanceof Node\UnionType || $node instanceof Node\IntersectionType) {
foreach ($node->types as &$type) {
$type = $this->resolveType($type);
}
return $node;
}
return $node;
}
|
@template T of Node\Identifier|Name|Node\ComplexType|null
@param T $node
@return T
|
resolveType
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php
|
MIT
|
protected function resolveName(Name $name, int $type) : Name
{
if (!$this->replaceNodes) {
$resolvedName = $this->nameContext->getResolvedName($name, $type);
if (null !== $resolvedName) {
$name->setAttribute('resolvedName', $resolvedName);
} else {
$name->setAttribute('namespacedName', FullyQualified::concat($this->nameContext->getNamespace(), $name, $name->getAttributes()));
}
return $name;
}
if ($this->preserveOriginalNames) {
// Save the original name
$originalName = $name;
$name = clone $originalName;
$name->setAttribute('originalName', $originalName);
}
$resolvedName = $this->nameContext->getResolvedName($name, $type);
if (null !== $resolvedName) {
return $resolvedName;
}
// unqualified names inside a namespace cannot be resolved at compile-time
// add the namespaced version of the name as an attribute
$name->setAttribute('namespacedName', FullyQualified::concat($this->nameContext->getNamespace(), $name, $name->getAttributes()));
return $name;
}
|
Resolve name, according to name resolver options.
@param Name $name Function or constant name to resolve
@param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_*
@return Name Resolved name, or original name with attribute
|
resolveName
|
php
|
deptrac/deptrac
|
vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php
|
MIT
|
public function __construct(string $key, string $value)
{
$this->key = $key;
$this->value = $value;
}
|
Creating a new attribute.
@param string $key Id for the new attribute.
@param string $value Value for this attribute,
|
__construct
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
MIT
|
public function setKey(string $key) : self
{
$this->key = $key;
return $this;
}
|
Sets the key for this attribute.
@param string $key The new name of this attribute.
|
setKey
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
MIT
|
public function getKey() : string
{
return $this->key;
}
|
Returns the name for this attribute.
|
getKey
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
MIT
|
public function setValue(string $value) : self
{
$this->value = $value;
return $this;
}
|
Sets the value for this attribute.
@param string $value The new value.
|
setValue
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
MIT
|
public function getValue() : string
{
return $this->value;
}
|
Returns the value for this attribute.
|
getValue
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
MIT
|
public function __toString() : string
{
$key = $this->getKey();
if ($key === 'url') {
$key = 'URL';
}
$value = $this->getValue();
if ($this->isValueContainingSpecials()) {
$value = '"' . $this->encodeSpecials() . '"';
} elseif (!$this->isValueInHtml()) {
$value = '"' . addslashes($value) . '"';
}
return $key . '=' . $value;
}
|
Returns the attribute definition as is requested by GraphViz.
|
__toString
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
MIT
|
public function isValueInHtml() : bool
{
$value = $this->getValue();
return isset($value[0]) && $value[0] === '<';
}
|
Returns whether the value contains HTML.
|
isValueInHtml
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
MIT
|
public function isValueContainingSpecials() : bool
{
return strstr($this->getValue(), '\\') !== \false;
}
|
Checks whether the value contains any any special characters needing escaping.
|
isValueContainingSpecials
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
MIT
|
protected function encodeSpecials() : string
{
$value = $this->getValue();
$regex = '(\'|"|\\x00|\\\\(?![\\\\NGETHLnlr]))';
return (string) preg_replace($regex, '\\\\$0', $value);
}
|
Encode special characters so the escape sequences aren't removed
@see http://www.graphviz.org/doc/info/attrs.html#k:escString
|
encodeSpecials
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Attribute.php
|
MIT
|
public function __construct(Node $from, Node $to)
{
$this->from = $from;
$this->to = $to;
}
|
Creates a new Edge / Link between the given nodes.
@param Node $from Starting node to create an Edge from.
@param Node $to Destination node where to create and
edge to.
|
__construct
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
MIT
|
public static function create(Node $from, Node $to) : self
{
return new self($from, $to);
}
|
Factory method used to assist with fluent interface handling.
See the examples for more details.
@param Node $from Starting node to create an Edge from.
@param Node $to Destination node where to create and
edge to.
|
create
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
MIT
|
public function getFrom() : Node
{
return $this->from;
}
|
Returns the source Node for this Edge.
|
getFrom
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
MIT
|
public function getTo() : Node
{
return $this->to;
}
|
Returns the destination Node for this Edge.
|
getTo
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
MIT
|
public function __call(string $name, array $arguments)
{
$key = strtolower(substr($name, 3));
if (strtolower(substr($name, 0, 3)) === 'set') {
return $this->setAttribute($key, (string) $arguments[0]);
}
if (strtolower(substr($name, 0, 3)) === 'get') {
return $this->getAttribute($key);
}
return null;
}
|
Magic method to provide a getter/setter to add attributes on the edge.
Using this method we make sure that we support any attribute without too
much hassle. If the name for this method does not start with get or set
we return null.
Set methods return this graph (fluent interface) whilst get methods
return the attribute value.
@param string $name name of the invoked method, expect it to be
setX or getX.
@param mixed[] $arguments Arguments for the setter, only 1 is expected: value
@return Attribute|Edge|null
@throws AttributeNotFound
|
__call
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
MIT
|
public function __toString() : string
{
$attributes = [];
foreach ($this->attributes as $value) {
$attributes[] = (string) $value;
}
$attributes = implode("\n", $attributes);
$fromName = addslashes($this->getFrom()->getName());
$toName = addslashes($this->getTo()->getName());
return <<<DOT
"{$fromName}" -> "{$toName}" [
{$attributes}
]
DOT;
}
|
Returns the edge definition as is requested by GraphViz.
|
__toString
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Edge.php
|
MIT
|
public static function create(string $name = 'G', bool $directional = \true) : self
{
$graph = new self();
$graph->setName($name)->setType($directional ? 'digraph' : 'graph');
return $graph;
}
|
Factory method to instantiate a Graph so that you can use fluent coding
to chain everything.
@param string $name The name for this graph.
@param bool $directional Whether this is a directed or undirected graph.
@return Graph
|
create
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function setPath(string $path) : self
{
$realpath = realpath($path);
if ($path && $path === $realpath) {
$this->path = $path . DIRECTORY_SEPARATOR;
}
return $this;
}
|
Sets the path for the execution. Only needed if it is not in the PATH env.
@param string $path The path to execute dot from
|
setPath
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function setName(string $name) : self
{
$this->name = $name;
return $this;
}
|
Sets the name for this graph.
If this is a subgraph you can prefix the name with _cluster_ to group all
contained nodes and add a border.
@param string $name The new name for this graph.
|
setName
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function getName() : string
{
return $this->name;
}
|
Returns the name for this Graph.
|
getName
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function setType(string $type) : self
{
if (!in_array($type, ['digraph', 'graph', 'subgraph'], \true)) {
throw new InvalidArgumentException('The type for a graph must be either "digraph", "graph" or ' . '"subgraph"');
}
$this->type = $type;
return $this;
}
|
Sets the type for this graph.
@param string $type Must be either "digraph", "graph" or "subgraph".
@throws InvalidArgumentException If $type is not "digraph", "graph" or
"subgraph".
|
setType
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function getType() : string
{
return $this->type;
}
|
Returns the type of this Graph.
|
getType
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function setStrict(bool $isStrict) : self
{
$this->strict = $isStrict;
return $this;
}
|
Set if the Graph should be strict. If the graph is strict then
multiple edges are not allowed between the same pairs of nodes
|
setStrict
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function __call(string $name, array $arguments)
{
$key = strtolower(substr($name, 3));
if (strtolower(substr($name, 0, 3)) === 'set') {
return $this->setAttribute($key, (string) $arguments[0]);
}
if (strtolower(substr($name, 0, 3)) === 'get') {
return $this->getAttribute($key);
}
return null;
}
|
Magic method to provide a getter/setter to add attributes on the Graph.
Using this method we make sure that we support any attribute without
too much hassle. If the name for this method does not start with get
or set we return null.
Set methods return this graph (fluent interface) whilst get methods
return the attribute value.
@param string $name Name of the method including get/set
@param mixed[] $arguments The arguments, should be 1: the value
@return Attribute|Graph|null
@throws AttributeNotFound
|
__call
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function addGraph(self $graph) : self
{
$graph->setType('subgraph');
$this->graphs[$graph->getName()] = $graph;
return $this;
}
|
Adds a subgraph to this graph; automatically changes the type to subgraph.
Please note that an index is maintained using the name of the subgraph.
Thus if you have 2 subgraphs with the same name that the first will be
overwritten by the latter.
@see Graph::create()
@param Graph $graph The graph to add onto this graph as
subgraph.
|
addGraph
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function hasGraph(string $name) : bool
{
return isset($this->graphs[$name]);
}
|
Checks whether a graph with a certain name already exists.
@param string $name Name of the graph to find.
|
hasGraph
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function getGraph(string $name) : self
{
return $this->graphs[$name];
}
|
Returns the subgraph with a given name.
@param string $name Name of the requested graph.
|
getGraph
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function setNode(Node $node) : self
{
$this->nodes[$node->getName()] = $node;
return $this;
}
|
Sets a node in the $nodes array; uses the name of the node as index.
Nodes can be retrieved by retrieving the property with the same name.
Thus 'node1' can be retrieved by invoking: $graph->node1
@see Node::create()
@param Node $node The node to set onto this Graph.
|
setNode
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function findNode(string $name) : ?Node
{
if (isset($this->nodes[$name])) {
return $this->nodes[$name];
}
foreach ($this->graphs as $graph) {
$node = $graph->findNode($name);
if ($node) {
return $node;
}
}
return null;
}
|
Finds a node in this graph or any of its subgraphs.
@param string $name Name of the node to find.
|
findNode
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function __set(string $name, Node $value) : void
{
$this->nodes[$name] = $value;
}
|
Sets a node using a custom name.
@see Graph::setNode()
@param string $name Name of the node.
@param Node $value Node to set on the given name.
|
__set
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function __get(string $name) : ?Node
{
return $this->nodes[$name] ?? null;
}
|
Returns the requested node by its name.
@see Graph::setNode()
@param string $name The name of the node to retrieve.
|
__get
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function link(Edge $edge) : self
{
$this->edges[] = $edge;
return $this;
}
|
Links two nodes to eachother and registers the Edge onto this graph.
@see Edge::create()
@param Edge $edge The link between two classes.
|
link
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function export(string $type, string $filename) : self
{
$type = escapeshellarg($type);
$filename = escapeshellarg($filename);
// write the dot file to a temporary file
$tmpfile = (string) tempnam(sys_get_temp_dir(), 'gvz');
file_put_contents($tmpfile, (string) $this);
// escape the temp file for use as argument
$tmpfileArg = escapeshellarg($tmpfile);
// create the dot output
$output = [];
$code = 0;
exec($this->path . "dot -T{$type} -o{$filename} < {$tmpfileArg} 2>&1", $output, $code);
unlink($tmpfile);
if ($code !== 0) {
throw new Exception('An error occurred while creating the graph; GraphViz returned: ' . implode(PHP_EOL, $output));
}
return $this;
}
|
Exports this graph to a generated image.
This is the only method that actually requires GraphViz.
@link http://www.graphviz.org/content/output-formats
@uses GraphViz/dot
@param string $type The type to export to; see the link above for a
list of supported types.
@param string $filename The path to write to.
@throws Exception If an error occurred in GraphViz.
|
export
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function __toString() : string
{
$elements = array_merge($this->graphs, $this->attributes, $this->edges, $this->nodes);
$attributes = [];
foreach ($elements as $value) {
$attributes[] = (string) $value;
}
$attributes = implode(PHP_EOL, $attributes);
$strict = $this->isStrict() ? 'strict ' : '';
return <<<DOT
{$strict}{$this->getType()} "{$this->getName()}" {
{$attributes}
}
DOT;
}
|
Generates a DOT file for use with GraphViz.
GraphViz is not used in this method; it is safe to call it even without
GraphViz installed.
|
__toString
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Graph.php
|
MIT
|
public function __construct(string $name, ?string $label = null)
{
$this->setName($name);
if ($label === null) {
return;
}
$this->setLabel($label);
}
|
Creates a new node with name and optional label.
@param string $name Name of the new node.
@param string|null $label Optional label text.
|
__construct
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
MIT
|
public static function create(string $name, ?string $label = null) : self
{
return new self($name, $label);
}
|
Factory method used to assist with fluent interface handling.
See the examples for more details.
@param string $name Name of the new node.
@param string|null $label Optional label text.
|
create
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
MIT
|
public function setName(string $name) : self
{
$this->name = $name;
return $this;
}
|
Sets the name for this node.
Not to confuse with the label.
@param string $name Name for this node.
|
setName
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
MIT
|
public function getName() : string
{
return $this->name;
}
|
Returns the name for this node.
|
getName
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
MIT
|
public function __call(string $name, array $arguments)
{
$key = strtolower(substr($name, 3));
if (strtolower(substr($name, 0, 3)) === 'set') {
return $this->setAttribute($key, (string) $arguments[0]);
}
if (strtolower(substr($name, 0, 3)) === 'get') {
return $this->getAttribute($key);
}
return null;
}
|
Magic method to provide a getter/setter to add attributes on the Node.
Using this method we make sure that we support any attribute without
too much hassle. If the name for this method does not start with get or
set we return null.
Set methods return this graph (fluent interface) whilst get methods
return the attribute value.
@param string $name Method name; either getX or setX is expected.
@param mixed[] $arguments List of arguments; only 1 is expected for setX.
@return Attribute|Node|null
@throws AttributeNotFound
|
__call
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
MIT
|
public function __toString() : string
{
$attributes = [];
foreach ($this->attributes as $value) {
$attributes[] = (string) $value;
}
$attributes = implode("\n", $attributes);
$name = addslashes($this->getName());
return <<<DOT
"{$name}" [
{$attributes}
]
DOT;
}
|
Returns the node definition as is requested by GraphViz.
|
__toString
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz/Node.php
|
MIT
|
public function __construct(string $fqsen)
{
$matches = [];
$result = preg_match(
//phpcs:ignore Generic.Files.LineLength.TooLong
'/^\\\\([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff\\\\]*)?(?:[:]{2}\\$?([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*))?(?:\\(\\))?$/',
$fqsen,
$matches
);
if ($result === 0) {
throw new InvalidArgumentException(sprintf('"%s" is not a valid Fqsen.', $fqsen));
}
$this->fqsen = $fqsen;
if (isset($matches[2])) {
$this->name = $matches[2];
} else {
$matches = explode('\\', $fqsen);
$name = end($matches);
assert(is_string($name));
$this->name = trim($name, '()');
}
}
|
Initializes the object.
@throws InvalidArgumentException when $fqsen is not matching the format.
|
__construct
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/reflection-common/src/Fqsen.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/reflection-common/src/Fqsen.php
|
MIT
|
public function getName() : string
{
return $this->name;
}
|
Returns the name of the element without path.
|
getName
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/reflection-common/src/Fqsen.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/reflection-common/src/Fqsen.php
|
MIT
|
public function __construct(int $lineNumber, int $columnNumber = 0)
{
$this->lineNumber = $lineNumber;
$this->columnNumber = $columnNumber;
}
|
Initializes the location for an element using its line number in the file and optionally the column number.
|
__construct
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/reflection-common/src/Location.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/reflection-common/src/Location.php
|
MIT
|
public function getLineNumber() : int
{
return $this->lineNumber;
}
|
Returns the line number that is covered by this location.
|
getLineNumber
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/reflection-common/src/Location.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/reflection-common/src/Location.php
|
MIT
|
public function getColumnNumber() : int
{
return $this->columnNumber;
}
|
Returns the column number (character position on a line) for this location object.
|
getColumnNumber
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/reflection-common/src/Location.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/reflection-common/src/Location.php
|
MIT
|
private function isFqsen(string $type) : bool
{
return strpos($type, self::OPERATOR_NAMESPACE) === 0;
}
|
Tests whether the given type is a Fully Qualified Structural Element Name.
|
isFqsen
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/type-resolver/src/FqsenResolver.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php
|
MIT
|
private function resolvePartialStructuralElementName(string $type, Context $context) : Fqsen
{
$typeParts = explode(self::OPERATOR_NAMESPACE, $type, 2);
$namespaceAliases = $context->getNamespaceAliases();
// if the first segment is not an alias; prepend namespace name and return
if (!isset($namespaceAliases[$typeParts[0]])) {
$namespace = $context->getNamespace();
if ($namespace !== '') {
$namespace .= self::OPERATOR_NAMESPACE;
}
return new Fqsen(self::OPERATOR_NAMESPACE . $namespace . $type);
}
$typeParts[0] = $namespaceAliases[$typeParts[0]];
return new Fqsen(self::OPERATOR_NAMESPACE . implode(self::OPERATOR_NAMESPACE, $typeParts));
}
|
Resolves a partial Structural Element Name (i.e. `Reflection\DocBlock`) to its FQSEN representation
(i.e. `\phpDocumentor\Reflection\DocBlock`) based on the Namespace and aliases mentioned in the Context.
@throws InvalidArgumentException When type is not a valid FQSEN.
|
resolvePartialStructuralElementName
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/type-resolver/src/FqsenResolver.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php
|
MIT
|
public function __construct(?FqsenResolver $fqsenResolver = null)
{
$this->fqsenResolver = $fqsenResolver ?: new FqsenResolver();
if (class_exists(ParserConfig::class)) {
$this->typeParser = new TypeParser(new ParserConfig([]), new ConstExprParser(new ParserConfig([])));
$this->lexer = new Lexer(new ParserConfig([]));
} else {
$this->typeParser = new TypeParser(new ConstExprParser());
$this->lexer = new Lexer();
}
}
|
Initializes this TypeResolver with the means to create and resolve Fqsen objects.
|
__construct
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/type-resolver/src/TypeResolver.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/type-resolver/src/TypeResolver.php
|
MIT
|
public function resolve(string $type, ?Context $context = null) : Type
{
$type = trim($type);
if (!$type) {
throw new InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be empty');
}
if ($context === null) {
$context = new Context('');
}
$tokens = $this->lexer->tokenize($type);
$tokenIterator = new TokenIterator($tokens);
$ast = $this->parse($tokenIterator);
$type = $this->createType($ast, $context);
return $this->tryParseRemainingCompoundTypes($tokenIterator, $context, $type);
}
|
Analyzes the given type and returns the FQCN variant.
When a type is provided this method checks whether it is not a keyword or
Fully Qualified Class Name. If so it will use the given namespace and
aliases to expand the type to a FQCN representation.
This method only works as expected if the namespace and aliases are set;
no dynamic reflection is being performed here.
@uses Context::getNamespace() to determine with what to prefix the type name.
@uses Context::getNamespaceAliases() to check whether the first part of the relative type name should not be
replaced with another namespace.
@param string $type The relative or absolute type.
|
resolve
|
php
|
deptrac/deptrac
|
vendor/phpdocumentor/type-resolver/src/TypeResolver.php
|
https://github.com/deptrac/deptrac/blob/master/vendor/phpdocumentor/type-resolver/src/TypeResolver.php
|
MIT
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.