Submit
Path:
~
/
/
usr
/
local
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
vendor
/
phpstan
/
phpdoc-parser
/
src
/
Ast
/
PhpDoc
/
File Content:
PhpDocNode.php
<?php declare (strict_types=1); namespace WPToolkitDependenciesIsolationPrefix\PHPStan\PhpDocParser\Ast\PhpDoc; use WPToolkitDependenciesIsolationPrefix\PHPStan\PhpDocParser\Ast\Node; use WPToolkitDependenciesIsolationPrefix\PHPStan\PhpDocParser\Ast\NodeAttributes; use function array_column; use function array_filter; use function array_map; use function implode; class PhpDocNode implements Node { use NodeAttributes; /** @var PhpDocChildNode[] */ public array $children; /** * @param PhpDocChildNode[] $children */ public function __construct(array $children) { $this->children = $children; } /** * @return PhpDocTagNode[] */ public function getTags() : array { return array_filter($this->children, static fn(PhpDocChildNode $child): bool => $child instanceof PhpDocTagNode); } /** * @return PhpDocTagNode[] */ public function getTagsByName(string $tagName) : array { return array_filter($this->getTags(), static fn(PhpDocTagNode $tag): bool => $tag->name === $tagName); } /** * @return VarTagValueNode[] */ public function getVarTagValues(string $tagName = '@var') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof VarTagValueNode); } /** * @return ParamTagValueNode[] */ public function getParamTagValues(string $tagName = '@param') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof ParamTagValueNode); } /** * @return TypelessParamTagValueNode[] */ public function getTypelessParamTagValues(string $tagName = '@param') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof TypelessParamTagValueNode); } /** * @return ParamImmediatelyInvokedCallableTagValueNode[] */ public function getParamImmediatelyInvokedCallableTagValues(string $tagName = '@param-immediately-invoked-callable') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof ParamImmediatelyInvokedCallableTagValueNode); } /** * @return ParamLaterInvokedCallableTagValueNode[] */ public function getParamLaterInvokedCallableTagValues(string $tagName = '@param-later-invoked-callable') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof ParamLaterInvokedCallableTagValueNode); } /** * @return ParamClosureThisTagValueNode[] */ public function getParamClosureThisTagValues(string $tagName = '@param-closure-this') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof ParamClosureThisTagValueNode); } /** * @return PureUnlessCallableIsImpureTagValueNode[] */ public function getPureUnlessCallableIsImpureTagValues(string $tagName = '@pure-unless-callable-is-impure') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof PureUnlessCallableIsImpureTagValueNode); } /** * @return TemplateTagValueNode[] */ public function getTemplateTagValues(string $tagName = '@template') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof TemplateTagValueNode); } /** * @return ExtendsTagValueNode[] */ public function getExtendsTagValues(string $tagName = '@extends') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof ExtendsTagValueNode); } /** * @return ImplementsTagValueNode[] */ public function getImplementsTagValues(string $tagName = '@implements') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof ImplementsTagValueNode); } /** * @return UsesTagValueNode[] */ public function getUsesTagValues(string $tagName = '@use') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof UsesTagValueNode); } /** * @return ReturnTagValueNode[] */ public function getReturnTagValues(string $tagName = '@return') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof ReturnTagValueNode); } /** * @return ThrowsTagValueNode[] */ public function getThrowsTagValues(string $tagName = '@throws') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof ThrowsTagValueNode); } /** * @return MixinTagValueNode[] */ public function getMixinTagValues(string $tagName = '@mixin') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof MixinTagValueNode); } /** * @return RequireExtendsTagValueNode[] */ public function getRequireExtendsTagValues(string $tagName = '@phpstan-require-extends') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof RequireExtendsTagValueNode); } /** * @return RequireImplementsTagValueNode[] */ public function getRequireImplementsTagValues(string $tagName = '@phpstan-require-implements') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof RequireImplementsTagValueNode); } /** * @return DeprecatedTagValueNode[] */ public function getDeprecatedTagValues() : array { return array_filter(array_column($this->getTagsByName('@deprecated'), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof DeprecatedTagValueNode); } /** * @return PropertyTagValueNode[] */ public function getPropertyTagValues(string $tagName = '@property') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof PropertyTagValueNode); } /** * @return PropertyTagValueNode[] */ public function getPropertyReadTagValues(string $tagName = '@property-read') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof PropertyTagValueNode); } /** * @return PropertyTagValueNode[] */ public function getPropertyWriteTagValues(string $tagName = '@property-write') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof PropertyTagValueNode); } /** * @return MethodTagValueNode[] */ public function getMethodTagValues(string $tagName = '@method') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof MethodTagValueNode); } /** * @return TypeAliasTagValueNode[] */ public function getTypeAliasTagValues(string $tagName = '@phpstan-type') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof TypeAliasTagValueNode); } /** * @return TypeAliasImportTagValueNode[] */ public function getTypeAliasImportTagValues(string $tagName = '@phpstan-import-type') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof TypeAliasImportTagValueNode); } /** * @return AssertTagValueNode[] */ public function getAssertTagValues(string $tagName = '@phpstan-assert') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof AssertTagValueNode); } /** * @return AssertTagPropertyValueNode[] */ public function getAssertPropertyTagValues(string $tagName = '@phpstan-assert') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof AssertTagPropertyValueNode); } /** * @return AssertTagMethodValueNode[] */ public function getAssertMethodTagValues(string $tagName = '@phpstan-assert') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof AssertTagMethodValueNode); } /** * @return SelfOutTagValueNode[] */ public function getSelfOutTypeTagValues(string $tagName = '@phpstan-this-out') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof SelfOutTagValueNode); } /** * @return ParamOutTagValueNode[] */ public function getParamOutTypeTagValues(string $tagName = '@param-out') : array { return array_filter(array_column($this->getTagsByName($tagName), 'value'), static fn(PhpDocTagValueNode $value): bool => $value instanceof ParamOutTagValueNode); } public function __toString() : string { $children = array_map(static function (PhpDocChildNode $child) : string { $s = (string) $child; return $s === '' ? '' : ' ' . $s; }, $this->children); return "/**\n *" . implode("\n *", $children) . "\n */"; } }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
Doctrine
---
0755
AssertTagMethodValueNode.php
1249 bytes
0644
AssertTagPropertyValueNode.php
1259 bytes
0644
AssertTagValueNode.php
1148 bytes
0644
DeprecatedTagValueNode.php
575 bytes
0644
ExtendsTagValueNode.php
764 bytes
0644
GenericTagValueNode.php
517 bytes
0644
ImplementsTagValueNode.php
767 bytes
0644
InvalidTagValueNode.php
1364 bytes
0644
MethodTagValueNode.php
1799 bytes
0644
MethodTagValueParameterNode.php
1442 bytes
0644
MixinTagValueNode.php
741 bytes
0644
ParamClosureThisTagValueNode.php
879 bytes
0644
ParamImmediatelyInvokedCallableTagValueNode.php
727 bytes
0644
ParamLaterInvokedCallableTagValueNode.php
721 bytes
0644
ParamOutTagValueNode.php
871 bytes
0644
ParamTagValueNode.php
1175 bytes
0644
PhpDocChildNode.php
229 bytes
0644
PhpDocNode.php
10635 bytes
0644
PhpDocTagNode.php
821 bytes
0644
PhpDocTagValueNode.php
232 bytes
0644
PhpDocTextNode.php
466 bytes
0644
PropertyTagValueNode.php
866 bytes
0644
PureUnlessCallableIsImpureTagValueNode.php
722 bytes
0644
RequireExtendsTagValueNode.php
750 bytes
0644
RequireImplementsTagValueNode.php
753 bytes
0644
ReturnTagValueNode.php
742 bytes
0644
SelfOutTagValueNode.php
745 bytes
0644
TemplateTagValueNode.php
1370 bytes
0644
ThrowsTagValueNode.php
742 bytes
0644
TypeAliasImportTagValueNode.php
963 bytes
0644
TypeAliasTagValueNode.php
677 bytes
0644
TypelessParamTagValueNode.php
1016 bytes
0644
UsesTagValueNode.php
761 bytes
0644
VarTagValueNode.php
910 bytes
0644
N4ST4R_ID | Naxtarrr