Composer Workspace global packages
This commit is contained in:
@@ -8,7 +8,7 @@ namespace PHPStan\PhpDocParser\Ast;
|
||||
* Copyright (c) 2011, Nikita Popov
|
||||
* All rights reserved.
|
||||
*/
|
||||
abstract class AbstractNodeVisitor implements NodeVisitor
|
||||
abstract class AbstractNodeVisitor implements NodeVisitor // phpcs:ignore SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming.SuperfluousPrefix
|
||||
{
|
||||
|
||||
public function beforeTraverse(array $nodes): ?array
|
||||
|
||||
35
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php
vendored
Normal file
35
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function implode;
|
||||
|
||||
class DoctrineAnnotation implements Node
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $name;
|
||||
|
||||
/** @var list<DoctrineArgument> */
|
||||
public $arguments;
|
||||
|
||||
/**
|
||||
* @param list<DoctrineArgument> $arguments
|
||||
*/
|
||||
public function __construct(string $name, array $arguments)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->arguments = $arguments;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$arguments = implode(', ', $this->arguments);
|
||||
return $this->name . '(' . $arguments . ')';
|
||||
}
|
||||
|
||||
}
|
||||
43
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArgument.php
vendored
Normal file
43
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArgument.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprNode;
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
|
||||
/**
|
||||
* @phpstan-type ValueType = DoctrineAnnotation|IdentifierTypeNode|DoctrineArray|ConstExprNode
|
||||
*/
|
||||
class DoctrineArgument implements Node
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var IdentifierTypeNode|null */
|
||||
public $key;
|
||||
|
||||
/** @var ValueType */
|
||||
public $value;
|
||||
|
||||
/**
|
||||
* @param ValueType $value
|
||||
*/
|
||||
public function __construct(?IdentifierTypeNode $key, $value)
|
||||
{
|
||||
$this->key = $key;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
if ($this->key === null) {
|
||||
return (string) $this->value;
|
||||
}
|
||||
|
||||
return $this->key . '=' . $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArray.php
vendored
Normal file
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArray.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function implode;
|
||||
|
||||
class DoctrineArray implements Node
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var list<DoctrineArrayItem> */
|
||||
public $items;
|
||||
|
||||
/**
|
||||
* @param list<DoctrineArrayItem> $items
|
||||
*/
|
||||
public function __construct(array $items)
|
||||
{
|
||||
$this->items = $items;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$items = implode(', ', $this->items);
|
||||
|
||||
return '{' . $items . '}';
|
||||
}
|
||||
|
||||
}
|
||||
47
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php
vendored
Normal file
47
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprIntegerNode;
|
||||
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprStringNode;
|
||||
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstFetchNode;
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
|
||||
/**
|
||||
* @phpstan-import-type ValueType from DoctrineArgument
|
||||
* @phpstan-type KeyType = ConstExprIntegerNode|ConstExprStringNode|IdentifierTypeNode|ConstFetchNode|null
|
||||
*/
|
||||
class DoctrineArrayItem implements Node
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var KeyType */
|
||||
public $key;
|
||||
|
||||
/** @var ValueType */
|
||||
public $value;
|
||||
|
||||
/**
|
||||
* @param KeyType $key
|
||||
* @param ValueType $value
|
||||
*/
|
||||
public function __construct($key, $value)
|
||||
{
|
||||
$this->key = $key;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
if ($this->key === null) {
|
||||
return (string) $this->value;
|
||||
}
|
||||
|
||||
return $this->key . '=' . $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
36
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php
vendored
Normal file
36
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode;
|
||||
use function trim;
|
||||
|
||||
class DoctrineTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var DoctrineAnnotation */
|
||||
public $annotation;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
|
||||
public function __construct(
|
||||
DoctrineAnnotation $annotation,
|
||||
string $description
|
||||
)
|
||||
{
|
||||
$this->annotation = $annotation;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->annotation} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine\DoctrineTagValueNode;
|
||||
use function trim;
|
||||
|
||||
class PhpDocTagNode implements PhpDocChildNode
|
||||
@@ -25,6 +26,10 @@ class PhpDocTagNode implements PhpDocChildNode
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
if ($this->value instanceof DoctrineTagValueNode) {
|
||||
return (string) $this->value;
|
||||
}
|
||||
|
||||
return trim("{$this->name} {$this->value}");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user