composer base packages updates
This commit is contained in:
36
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayItemNode.php
vendored
Normal file
36
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayItemNode.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function sprintf;
|
||||
|
||||
class ConstExprArrayItemNode implements ConstExprNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var ConstExprNode|null */
|
||||
public $key;
|
||||
|
||||
/** @var ConstExprNode */
|
||||
public $value;
|
||||
|
||||
public function __construct(?ConstExprNode $key, ConstExprNode $value)
|
||||
{
|
||||
$this->key = $key;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
if ($this->key !== null) {
|
||||
return sprintf('%s => %s', $this->key, $this->value);
|
||||
|
||||
}
|
||||
|
||||
return (string) $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
30
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayNode.php
vendored
Normal file
30
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayNode.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function implode;
|
||||
|
||||
class ConstExprArrayNode implements ConstExprNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var ConstExprArrayItemNode[] */
|
||||
public $items;
|
||||
|
||||
/**
|
||||
* @param ConstExprArrayItemNode[] $items
|
||||
*/
|
||||
public function __construct(array $items)
|
||||
{
|
||||
$this->items = $items;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return '[' . implode(', ', $this->items) . ']';
|
||||
}
|
||||
|
||||
}
|
||||
17
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFalseNode.php
vendored
Normal file
17
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFalseNode.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class ConstExprFalseNode implements ConstExprNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'false';
|
||||
}
|
||||
|
||||
}
|
||||
26
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFloatNode.php
vendored
Normal file
26
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFloatNode.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class ConstExprFloatNode implements ConstExprNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $value;
|
||||
|
||||
public function __construct(string $value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
26
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprIntegerNode.php
vendored
Normal file
26
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprIntegerNode.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class ConstExprIntegerNode implements ConstExprNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $value;
|
||||
|
||||
public function __construct(string $value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
10
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php
vendored
Normal file
10
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
|
||||
interface ConstExprNode extends Node
|
||||
{
|
||||
|
||||
}
|
||||
17
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNullNode.php
vendored
Normal file
17
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNullNode.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class ConstExprNullNode implements ConstExprNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'null';
|
||||
}
|
||||
|
||||
}
|
||||
26
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprStringNode.php
vendored
Normal file
26
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprStringNode.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class ConstExprStringNode implements ConstExprNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $value;
|
||||
|
||||
public function __construct(string $value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
17
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprTrueNode.php
vendored
Normal file
17
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprTrueNode.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class ConstExprTrueNode implements ConstExprNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'true';
|
||||
}
|
||||
|
||||
}
|
||||
35
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstFetchNode.php
vendored
Normal file
35
vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstFetchNode.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class ConstFetchNode implements ConstExprNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string class name for class constants or empty string for non-class constants */
|
||||
public $className;
|
||||
|
||||
/** @var string */
|
||||
public $name;
|
||||
|
||||
public function __construct(string $className, string $name)
|
||||
{
|
||||
$this->className = $className;
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
if ($this->className === '') {
|
||||
return $this->name;
|
||||
|
||||
}
|
||||
|
||||
return "{$this->className}::{$this->name}";
|
||||
}
|
||||
|
||||
}
|
||||
22
vendor/phpstan/phpdoc-parser/src/Ast/Node.php
vendored
Normal file
22
vendor/phpstan/phpdoc-parser/src/Ast/Node.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast;
|
||||
|
||||
interface Node
|
||||
{
|
||||
|
||||
public function __toString(): string;
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setAttribute(string $key, $value): void;
|
||||
|
||||
public function hasAttribute(string $key): bool;
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAttribute(string $key);
|
||||
|
||||
}
|
||||
38
vendor/phpstan/phpdoc-parser/src/Ast/NodeAttributes.php
vendored
Normal file
38
vendor/phpstan/phpdoc-parser/src/Ast/NodeAttributes.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast;
|
||||
|
||||
use function array_key_exists;
|
||||
|
||||
trait NodeAttributes
|
||||
{
|
||||
|
||||
/** @var array<string, mixed> */
|
||||
private $attributes = [];
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setAttribute(string $key, $value): void
|
||||
{
|
||||
$this->attributes[$key] = $value;
|
||||
}
|
||||
|
||||
public function hasAttribute(string $key): bool
|
||||
{
|
||||
return array_key_exists($key, $this->attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAttribute(string $key)
|
||||
{
|
||||
if ($this->hasAttribute($key)) {
|
||||
return $this->attributes[$key];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
50
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagMethodValueNode.php
vendored
Normal file
50
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagMethodValueNode.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class AssertTagMethodValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string */
|
||||
public $parameter;
|
||||
|
||||
/** @var string */
|
||||
public $method;
|
||||
|
||||
/** @var bool */
|
||||
public $isNegated;
|
||||
|
||||
/** @var bool */
|
||||
public $isEquality;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, string $parameter, string $method, bool $isNegated, string $description, bool $isEquality = false)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->parameter = $parameter;
|
||||
$this->method = $method;
|
||||
$this->isNegated = $isNegated;
|
||||
$this->isEquality = $isEquality;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$isNegated = $this->isNegated ? '!' : '';
|
||||
$isEquality = $this->isEquality ? '=' : '';
|
||||
return trim("{$isNegated}{$isEquality}{$this->type} {$this->parameter}->{$this->method}() {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
50
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagPropertyValueNode.php
vendored
Normal file
50
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagPropertyValueNode.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class AssertTagPropertyValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string */
|
||||
public $parameter;
|
||||
|
||||
/** @var string */
|
||||
public $property;
|
||||
|
||||
/** @var bool */
|
||||
public $isNegated;
|
||||
|
||||
/** @var bool */
|
||||
public $isEquality;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, string $parameter, string $property, bool $isNegated, string $description, bool $isEquality = false)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->parameter = $parameter;
|
||||
$this->property = $property;
|
||||
$this->isNegated = $isNegated;
|
||||
$this->isEquality = $isEquality;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$isNegated = $this->isNegated ? '!' : '';
|
||||
$isEquality = $this->isEquality ? '=' : '';
|
||||
return trim("{$isNegated}{$isEquality}{$this->type} {$this->parameter}->{$this->property} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
46
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagValueNode.php
vendored
Normal file
46
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagValueNode.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class AssertTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string */
|
||||
public $parameter;
|
||||
|
||||
/** @var bool */
|
||||
public $isNegated;
|
||||
|
||||
/** @var bool */
|
||||
public $isEquality;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, string $parameter, bool $isNegated, string $description, bool $isEquality = false)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->parameter = $parameter;
|
||||
$this->isNegated = $isNegated;
|
||||
$this->isEquality = $isEquality;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$isNegated = $this->isNegated ? '!' : '';
|
||||
$isEquality = $this->isEquality ? '=' : '';
|
||||
return trim("{$isNegated}{$isEquality}{$this->type} {$this->parameter} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
27
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/DeprecatedTagValueNode.php
vendored
Normal file
27
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/DeprecatedTagValueNode.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function trim;
|
||||
|
||||
class DeprecatedTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(string $description)
|
||||
{
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim($this->description);
|
||||
}
|
||||
|
||||
}
|
||||
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ExtendsTagValueNode.php
vendored
Normal file
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ExtendsTagValueNode.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode;
|
||||
use function trim;
|
||||
|
||||
class ExtendsTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var GenericTypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(GenericTypeNode $type, string $description)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->type} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
26
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/GenericTagValueNode.php
vendored
Normal file
26
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/GenericTagValueNode.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class GenericTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $value;
|
||||
|
||||
public function __construct(string $value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ImplementsTagValueNode.php
vendored
Normal file
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ImplementsTagValueNode.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode;
|
||||
use function trim;
|
||||
|
||||
class ImplementsTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var GenericTypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(GenericTypeNode $type, string $description)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->type} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
52
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php
vendored
Normal file
52
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Parser\ParserException;
|
||||
use function sprintf;
|
||||
use function trigger_error;
|
||||
use const E_USER_WARNING;
|
||||
|
||||
/**
|
||||
* @property ParserException $exception
|
||||
*/
|
||||
class InvalidTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $value;
|
||||
|
||||
/** @var mixed[] */
|
||||
private $exceptionArgs;
|
||||
|
||||
public function __construct(string $value, ParserException $exception)
|
||||
{
|
||||
$this->value = $value;
|
||||
$this->exceptionArgs = [
|
||||
$exception->getCurrentTokenValue(),
|
||||
$exception->getCurrentTokenType(),
|
||||
$exception->getCurrentOffset(),
|
||||
$exception->getExpectedTokenType(),
|
||||
$exception->getExpectedTokenValue(),
|
||||
];
|
||||
}
|
||||
|
||||
public function __get(string $name)
|
||||
{
|
||||
if ($name !== 'exception') {
|
||||
trigger_error(sprintf('Undefined property: %s::$%s', self::class, $name), E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ParserException(...$this->exceptionArgs);
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
54
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php
vendored
Normal file
54
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function count;
|
||||
use function implode;
|
||||
|
||||
class MethodTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var bool */
|
||||
public $isStatic;
|
||||
|
||||
/** @var TypeNode|null */
|
||||
public $returnType;
|
||||
|
||||
/** @var string */
|
||||
public $methodName;
|
||||
|
||||
/** @var TemplateTagValueNode[] */
|
||||
public $templateTypes;
|
||||
|
||||
/** @var MethodTagValueParameterNode[] */
|
||||
public $parameters;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(bool $isStatic, ?TypeNode $returnType, string $methodName, array $parameters, string $description, array $templateTypes = [])
|
||||
{
|
||||
$this->isStatic = $isStatic;
|
||||
$this->returnType = $returnType;
|
||||
$this->methodName = $methodName;
|
||||
$this->parameters = $parameters;
|
||||
$this->description = $description;
|
||||
$this->templateTypes = $templateTypes;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$static = $this->isStatic ? 'static ' : '';
|
||||
$returnType = $this->returnType !== null ? "{$this->returnType} " : '';
|
||||
$parameters = implode(', ', $this->parameters);
|
||||
$description = $this->description !== '' ? " {$this->description}" : '';
|
||||
$templateTypes = count($this->templateTypes) > 0 ? '<' . implode(', ', $this->templateTypes) . '>' : '';
|
||||
return "{$static}{$returnType}{$this->methodName}{$templateTypes}({$parameters}){$description}";
|
||||
}
|
||||
|
||||
}
|
||||
49
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueParameterNode.php
vendored
Normal file
49
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueParameterNode.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprNode;
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
|
||||
class MethodTagValueParameterNode implements Node
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode|null */
|
||||
public $type;
|
||||
|
||||
/** @var bool */
|
||||
public $isReference;
|
||||
|
||||
/** @var bool */
|
||||
public $isVariadic;
|
||||
|
||||
/** @var string */
|
||||
public $parameterName;
|
||||
|
||||
/** @var ConstExprNode|null */
|
||||
public $defaultValue;
|
||||
|
||||
public function __construct(?TypeNode $type, bool $isReference, bool $isVariadic, string $parameterName, ?ConstExprNode $defaultValue)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->isReference = $isReference;
|
||||
$this->isVariadic = $isVariadic;
|
||||
$this->parameterName = $parameterName;
|
||||
$this->defaultValue = $defaultValue;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$type = $this->type !== null ? "{$this->type} " : '';
|
||||
$isReference = $this->isReference ? '&' : '';
|
||||
$isVariadic = $this->isVariadic ? '...' : '';
|
||||
$default = $this->defaultValue !== null ? " = {$this->defaultValue}" : '';
|
||||
return "{$type}{$isReference}{$isVariadic}{$this->parameterName}{$default}";
|
||||
}
|
||||
|
||||
}
|
||||
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MixinTagValueNode.php
vendored
Normal file
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MixinTagValueNode.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class MixinTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, string $description)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->type} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
35
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamOutTagValueNode.php
vendored
Normal file
35
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamOutTagValueNode.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class ParamOutTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string */
|
||||
public $parameterName;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, string $parameterName, string $description)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->parameterName = $parameterName;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->type} {$this->parameterName} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
46
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamTagValueNode.php
vendored
Normal file
46
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamTagValueNode.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class ParamTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var bool */
|
||||
public $isReference;
|
||||
|
||||
/** @var bool */
|
||||
public $isVariadic;
|
||||
|
||||
/** @var string */
|
||||
public $parameterName;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, bool $isVariadic, string $parameterName, string $description, bool $isReference = false)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->isReference = $isReference;
|
||||
$this->isVariadic = $isVariadic;
|
||||
$this->parameterName = $parameterName;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$reference = $this->isReference ? '&' : '';
|
||||
$variadic = $this->isVariadic ? '...' : '';
|
||||
return trim("{$this->type} {$reference}{$variadic}{$this->parameterName} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
10
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocChildNode.php
vendored
Normal file
10
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocChildNode.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
|
||||
interface PhpDocChildNode extends Node
|
||||
{
|
||||
|
||||
}
|
||||
371
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocNode.php
vendored
Normal file
371
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocNode.php
vendored
Normal file
@@ -0,0 +1,371 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
use 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 $children;
|
||||
|
||||
/**
|
||||
* @param PhpDocChildNode[] $children
|
||||
*/
|
||||
public function __construct(array $children)
|
||||
{
|
||||
$this->children = $children;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return PhpDocTagNode[]
|
||||
*/
|
||||
public function getTags(): array
|
||||
{
|
||||
return array_filter($this->children, static function (PhpDocChildNode $child): bool {
|
||||
return $child instanceof PhpDocTagNode;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return PhpDocTagNode[]
|
||||
*/
|
||||
public function getTagsByName(string $tagName): array
|
||||
{
|
||||
return array_filter($this->getTags(), static function (PhpDocTagNode $tag) use ($tagName): bool {
|
||||
return $tag->name === $tagName;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return VarTagValueNode[]
|
||||
*/
|
||||
public function getVarTagValues(string $tagName = '@var'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof VarTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return ParamTagValueNode[]
|
||||
*/
|
||||
public function getParamTagValues(string $tagName = '@param'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof ParamTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return TypelessParamTagValueNode[]
|
||||
*/
|
||||
public function getTypelessParamTagValues(string $tagName = '@param'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof TypelessParamTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return TemplateTagValueNode[]
|
||||
*/
|
||||
public function getTemplateTagValues(string $tagName = '@template'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof TemplateTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return ExtendsTagValueNode[]
|
||||
*/
|
||||
public function getExtendsTagValues(string $tagName = '@extends'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof ExtendsTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return ImplementsTagValueNode[]
|
||||
*/
|
||||
public function getImplementsTagValues(string $tagName = '@implements'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof ImplementsTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return UsesTagValueNode[]
|
||||
*/
|
||||
public function getUsesTagValues(string $tagName = '@use'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof UsesTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return ReturnTagValueNode[]
|
||||
*/
|
||||
public function getReturnTagValues(string $tagName = '@return'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof ReturnTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return ThrowsTagValueNode[]
|
||||
*/
|
||||
public function getThrowsTagValues(string $tagName = '@throws'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof ThrowsTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return MixinTagValueNode[]
|
||||
*/
|
||||
public function getMixinTagValues(string $tagName = '@mixin'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof MixinTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return DeprecatedTagValueNode[]
|
||||
*/
|
||||
public function getDeprecatedTagValues(): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName('@deprecated'), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof DeprecatedTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return PropertyTagValueNode[]
|
||||
*/
|
||||
public function getPropertyTagValues(string $tagName = '@property'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof PropertyTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return PropertyTagValueNode[]
|
||||
*/
|
||||
public function getPropertyReadTagValues(string $tagName = '@property-read'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof PropertyTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return PropertyTagValueNode[]
|
||||
*/
|
||||
public function getPropertyWriteTagValues(string $tagName = '@property-write'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof PropertyTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return MethodTagValueNode[]
|
||||
*/
|
||||
public function getMethodTagValues(string $tagName = '@method'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof MethodTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return TypeAliasTagValueNode[]
|
||||
*/
|
||||
public function getTypeAliasTagValues(string $tagName = '@phpstan-type'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof TypeAliasTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return TypeAliasImportTagValueNode[]
|
||||
*/
|
||||
public function getTypeAliasImportTagValues(string $tagName = '@phpstan-import-type'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof TypeAliasImportTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return AssertTagValueNode[]
|
||||
*/
|
||||
public function getAssertTagValues(string $tagName = '@phpstan-assert'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof AssertTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return AssertTagPropertyValueNode[]
|
||||
*/
|
||||
public function getAssertPropertyTagValues(string $tagName = '@phpstan-assert'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof AssertTagPropertyValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return AssertTagMethodValueNode[]
|
||||
*/
|
||||
public function getAssertMethodTagValues(string $tagName = '@phpstan-assert'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof AssertTagMethodValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return SelfOutTagValueNode[]
|
||||
*/
|
||||
public function getSelfOutTypeTagValues(string $tagName = '@phpstan-this-out'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $value instanceof SelfOutTagValueNode;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return ParamOutTagValueNode[]
|
||||
*/
|
||||
public function getParamOutTypeTagValues(string $tagName = '@param-out'): array
|
||||
{
|
||||
return array_filter(
|
||||
array_column($this->getTagsByName($tagName), 'value'),
|
||||
static function (PhpDocTagValueNode $value): bool {
|
||||
return $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 */";
|
||||
}
|
||||
|
||||
}
|
||||
31
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php
vendored
Normal file
31
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function trim;
|
||||
|
||||
class PhpDocTagNode implements PhpDocChildNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $name;
|
||||
|
||||
/** @var PhpDocTagValueNode */
|
||||
public $value;
|
||||
|
||||
public function __construct(string $name, PhpDocTagValueNode $value)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->name} {$this->value}");
|
||||
}
|
||||
|
||||
}
|
||||
10
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php
vendored
Normal file
10
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
|
||||
interface PhpDocTagValueNode extends Node
|
||||
{
|
||||
|
||||
}
|
||||
26
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTextNode.php
vendored
Normal file
26
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTextNode.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class PhpDocTextNode implements PhpDocChildNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $text;
|
||||
|
||||
public function __construct(string $text)
|
||||
{
|
||||
$this->text = $text;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
}
|
||||
36
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PropertyTagValueNode.php
vendored
Normal file
36
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PropertyTagValueNode.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class PropertyTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string */
|
||||
public $propertyName;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, string $propertyName, string $description)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->propertyName = $propertyName;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->type} {$this->propertyName} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ReturnTagValueNode.php
vendored
Normal file
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ReturnTagValueNode.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class ReturnTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, string $description)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->type} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/SelfOutTagValueNode.php
vendored
Normal file
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/SelfOutTagValueNode.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class SelfOutTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, string $description)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim($this->type . ' ' . $this->description);
|
||||
}
|
||||
|
||||
}
|
||||
42
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TemplateTagValueNode.php
vendored
Normal file
42
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TemplateTagValueNode.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class TemplateTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $name;
|
||||
|
||||
/** @var TypeNode|null */
|
||||
public $bound;
|
||||
|
||||
/** @var TypeNode|null */
|
||||
public $default;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(string $name, ?TypeNode $bound, string $description, ?TypeNode $default = null)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->bound = $bound;
|
||||
$this->default = $default;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$bound = $this->bound !== null ? " of {$this->bound}" : '';
|
||||
$default = $this->default !== null ? " = {$this->default}" : '';
|
||||
return trim("{$this->name}{$bound}{$default} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ThrowsTagValueNode.php
vendored
Normal file
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ThrowsTagValueNode.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class ThrowsTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, string $description)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->type} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
38
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasImportTagValueNode.php
vendored
Normal file
38
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasImportTagValueNode.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
use function trim;
|
||||
|
||||
class TypeAliasImportTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $importedAlias;
|
||||
|
||||
/** @var IdentifierTypeNode */
|
||||
public $importedFrom;
|
||||
|
||||
/** @var string|null */
|
||||
public $importedAs;
|
||||
|
||||
public function __construct(string $importedAlias, IdentifierTypeNode $importedFrom, ?string $importedAs)
|
||||
{
|
||||
$this->importedAlias = $importedAlias;
|
||||
$this->importedFrom = $importedFrom;
|
||||
$this->importedAs = $importedAs;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim(
|
||||
"{$this->importedAlias} from {$this->importedFrom}"
|
||||
. ($this->importedAs !== null ? " as {$this->importedAs}" : '')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasTagValueNode.php
vendored
Normal file
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasTagValueNode.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class TypeAliasTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $alias;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
public function __construct(string $alias, TypeNode $type)
|
||||
{
|
||||
$this->alias = $alias;
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->alias} {$this->type}");
|
||||
}
|
||||
|
||||
}
|
||||
41
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypelessParamTagValueNode.php
vendored
Normal file
41
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypelessParamTagValueNode.php
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function trim;
|
||||
|
||||
class TypelessParamTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var bool */
|
||||
public $isReference;
|
||||
|
||||
/** @var bool */
|
||||
public $isVariadic;
|
||||
|
||||
/** @var string */
|
||||
public $parameterName;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(bool $isVariadic, string $parameterName, string $description, bool $isReference = false)
|
||||
{
|
||||
$this->isReference = $isReference;
|
||||
$this->isVariadic = $isVariadic;
|
||||
$this->parameterName = $parameterName;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$reference = $this->isReference ? '&' : '';
|
||||
$variadic = $this->isVariadic ? '...' : '';
|
||||
return trim("{$reference}{$variadic}{$this->parameterName} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/UsesTagValueNode.php
vendored
Normal file
32
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/UsesTagValueNode.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode;
|
||||
use function trim;
|
||||
|
||||
class UsesTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var GenericTypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(GenericTypeNode $type, string $description)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("{$this->type} {$this->description}");
|
||||
}
|
||||
|
||||
}
|
||||
36
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/VarTagValueNode.php
vendored
Normal file
36
vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/VarTagValueNode.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use function trim;
|
||||
|
||||
class VarTagValueNode implements PhpDocTagValueNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $variableName;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $description;
|
||||
|
||||
public function __construct(TypeNode $type, string $variableName, string $description)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->variableName = $variableName;
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return trim("$this->type " . trim("{$this->variableName} {$this->description}"));
|
||||
}
|
||||
|
||||
}
|
||||
49
vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeItemNode.php
vendored
Normal file
49
vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeItemNode.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprIntegerNode;
|
||||
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprStringNode;
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function sprintf;
|
||||
|
||||
class ArrayShapeItemNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var ConstExprIntegerNode|ConstExprStringNode|IdentifierTypeNode|null */
|
||||
public $keyName;
|
||||
|
||||
/** @var bool */
|
||||
public $optional;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $valueType;
|
||||
|
||||
/**
|
||||
* @param ConstExprIntegerNode|ConstExprStringNode|IdentifierTypeNode|null $keyName
|
||||
*/
|
||||
public function __construct($keyName, bool $optional, TypeNode $valueType)
|
||||
{
|
||||
$this->keyName = $keyName;
|
||||
$this->optional = $optional;
|
||||
$this->valueType = $valueType;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
if ($this->keyName !== null) {
|
||||
return sprintf(
|
||||
'%s%s: %s',
|
||||
(string) $this->keyName,
|
||||
$this->optional ? '?' : '',
|
||||
(string) $this->valueType
|
||||
);
|
||||
}
|
||||
|
||||
return (string) $this->valueType;
|
||||
}
|
||||
|
||||
}
|
||||
47
vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php
vendored
Normal file
47
vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function implode;
|
||||
|
||||
class ArrayShapeNode implements TypeNode
|
||||
{
|
||||
|
||||
public const KIND_ARRAY = 'array';
|
||||
public const KIND_LIST = 'list';
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var ArrayShapeItemNode[] */
|
||||
public $items;
|
||||
|
||||
/** @var bool */
|
||||
public $sealed;
|
||||
|
||||
/** @var self::KIND_* */
|
||||
public $kind;
|
||||
|
||||
/**
|
||||
* @param self::KIND_* $kind
|
||||
*/
|
||||
public function __construct(array $items, bool $sealed = true, string $kind = self::KIND_ARRAY)
|
||||
{
|
||||
$this->items = $items;
|
||||
$this->sealed = $sealed;
|
||||
$this->kind = $kind;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$items = $this->items;
|
||||
|
||||
if (! $this->sealed) {
|
||||
$items[] = '...';
|
||||
}
|
||||
|
||||
return $this->kind . '{' . implode(', ', $items) . '}';
|
||||
}
|
||||
|
||||
}
|
||||
26
vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php
vendored
Normal file
26
vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class ArrayTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
public function __construct(TypeNode $type)
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->type . '[]';
|
||||
}
|
||||
|
||||
}
|
||||
36
vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php
vendored
Normal file
36
vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function implode;
|
||||
|
||||
class CallableTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var IdentifierTypeNode */
|
||||
public $identifier;
|
||||
|
||||
/** @var CallableTypeParameterNode[] */
|
||||
public $parameters;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $returnType;
|
||||
|
||||
public function __construct(IdentifierTypeNode $identifier, array $parameters, TypeNode $returnType)
|
||||
{
|
||||
$this->identifier = $identifier;
|
||||
$this->parameters = $parameters;
|
||||
$this->returnType = $returnType;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$parameters = implode(', ', $this->parameters);
|
||||
return "{$this->identifier}({$parameters}): {$this->returnType}";
|
||||
}
|
||||
|
||||
}
|
||||
48
vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php
vendored
Normal file
48
vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function trim;
|
||||
|
||||
class CallableTypeParameterNode implements Node
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var bool */
|
||||
public $isReference;
|
||||
|
||||
/** @var bool */
|
||||
public $isVariadic;
|
||||
|
||||
/** @var string (may be empty) */
|
||||
public $parameterName;
|
||||
|
||||
/** @var bool */
|
||||
public $isOptional;
|
||||
|
||||
public function __construct(TypeNode $type, bool $isReference, bool $isVariadic, string $parameterName, bool $isOptional)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->isReference = $isReference;
|
||||
$this->isVariadic = $isVariadic;
|
||||
$this->parameterName = $parameterName;
|
||||
$this->isOptional = $isOptional;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$type = "{$this->type} ";
|
||||
$isReference = $this->isReference ? '&' : '';
|
||||
$isVariadic = $this->isVariadic ? '...' : '';
|
||||
$default = $this->isOptional ? ' = default' : '';
|
||||
return trim("{$type}{$isReference}{$isVariadic}{$this->parameterName}") . $default;
|
||||
}
|
||||
|
||||
}
|
||||
49
vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeForParameterNode.php
vendored
Normal file
49
vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeForParameterNode.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function sprintf;
|
||||
|
||||
class ConditionalTypeForParameterNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $parameterName;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $targetType;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $if;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $else;
|
||||
|
||||
/** @var bool */
|
||||
public $negated;
|
||||
|
||||
public function __construct(string $parameterName, TypeNode $targetType, TypeNode $if, TypeNode $else, bool $negated)
|
||||
{
|
||||
$this->parameterName = $parameterName;
|
||||
$this->targetType = $targetType;
|
||||
$this->if = $if;
|
||||
$this->else = $else;
|
||||
$this->negated = $negated;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf(
|
||||
'(%s %s %s ? %s : %s)',
|
||||
$this->parameterName,
|
||||
$this->negated ? 'is not' : 'is',
|
||||
$this->targetType,
|
||||
$this->if,
|
||||
$this->else
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
49
vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeNode.php
vendored
Normal file
49
vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeNode.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function sprintf;
|
||||
|
||||
class ConditionalTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $subjectType;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $targetType;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $if;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $else;
|
||||
|
||||
/** @var bool */
|
||||
public $negated;
|
||||
|
||||
public function __construct(TypeNode $subjectType, TypeNode $targetType, TypeNode $if, TypeNode $else, bool $negated)
|
||||
{
|
||||
$this->subjectType = $subjectType;
|
||||
$this->targetType = $targetType;
|
||||
$this->if = $if;
|
||||
$this->else = $else;
|
||||
$this->negated = $negated;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf(
|
||||
'(%s %s %s ? %s : %s)',
|
||||
$this->subjectType,
|
||||
$this->negated ? 'is not' : 'is',
|
||||
$this->targetType,
|
||||
$this->if,
|
||||
$this->else
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
26
vendor/phpstan/phpdoc-parser/src/Ast/Type/ConstTypeNode.php
vendored
Normal file
26
vendor/phpstan/phpdoc-parser/src/Ast/Type/ConstTypeNode.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprNode;
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class ConstTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var ConstExprNode */
|
||||
public $constExpr;
|
||||
|
||||
public function __construct(ConstExprNode $constExpr)
|
||||
{
|
||||
$this->constExpr = $constExpr;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->constExpr->__toString();
|
||||
}
|
||||
|
||||
}
|
||||
54
vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php
vendored
Normal file
54
vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function implode;
|
||||
use function sprintf;
|
||||
|
||||
class GenericTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
public const VARIANCE_INVARIANT = 'invariant';
|
||||
public const VARIANCE_COVARIANT = 'covariant';
|
||||
public const VARIANCE_CONTRAVARIANT = 'contravariant';
|
||||
public const VARIANCE_BIVARIANT = 'bivariant';
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var IdentifierTypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var TypeNode[] */
|
||||
public $genericTypes;
|
||||
|
||||
/** @var (self::VARIANCE_*)[] */
|
||||
public $variances;
|
||||
|
||||
public function __construct(IdentifierTypeNode $type, array $genericTypes, array $variances = [])
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->genericTypes = $genericTypes;
|
||||
$this->variances = $variances;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$genericTypes = [];
|
||||
|
||||
foreach ($this->genericTypes as $index => $type) {
|
||||
$variance = $this->variances[$index] ?? self::VARIANCE_INVARIANT;
|
||||
if ($variance === self::VARIANCE_INVARIANT) {
|
||||
$genericTypes[] = (string) $type;
|
||||
} elseif ($variance === self::VARIANCE_BIVARIANT) {
|
||||
$genericTypes[] = '*';
|
||||
} else {
|
||||
$genericTypes[] = sprintf('%s %s', $variance, $type);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->type . '<' . implode(', ', $genericTypes) . '>';
|
||||
}
|
||||
|
||||
}
|
||||
26
vendor/phpstan/phpdoc-parser/src/Ast/Type/IdentifierTypeNode.php
vendored
Normal file
26
vendor/phpstan/phpdoc-parser/src/Ast/Type/IdentifierTypeNode.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class IdentifierTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var string */
|
||||
public $name;
|
||||
|
||||
public function __construct(string $name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
}
|
||||
27
vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php
vendored
Normal file
27
vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function implode;
|
||||
|
||||
class IntersectionTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode[] */
|
||||
public $types;
|
||||
|
||||
public function __construct(array $types)
|
||||
{
|
||||
$this->types = $types;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return '(' . implode(' & ', $this->types) . ')';
|
||||
}
|
||||
|
||||
}
|
||||
26
vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php
vendored
Normal file
26
vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class NullableTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
public function __construct(TypeNode $type)
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return '?' . $this->type;
|
||||
}
|
||||
|
||||
}
|
||||
29
vendor/phpstan/phpdoc-parser/src/Ast/Type/OffsetAccessTypeNode.php
vendored
Normal file
29
vendor/phpstan/phpdoc-parser/src/Ast/Type/OffsetAccessTypeNode.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class OffsetAccessTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $type;
|
||||
|
||||
/** @var TypeNode */
|
||||
public $offset;
|
||||
|
||||
public function __construct(TypeNode $type, TypeNode $offset)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->offset = $offset;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->type . '[' . $this->offset . ']';
|
||||
}
|
||||
|
||||
}
|
||||
17
vendor/phpstan/phpdoc-parser/src/Ast/Type/ThisTypeNode.php
vendored
Normal file
17
vendor/phpstan/phpdoc-parser/src/Ast/Type/ThisTypeNode.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
|
||||
class ThisTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return '$this';
|
||||
}
|
||||
|
||||
}
|
||||
10
vendor/phpstan/phpdoc-parser/src/Ast/Type/TypeNode.php
vendored
Normal file
10
vendor/phpstan/phpdoc-parser/src/Ast/Type/TypeNode.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
|
||||
interface TypeNode extends Node
|
||||
{
|
||||
|
||||
}
|
||||
27
vendor/phpstan/phpdoc-parser/src/Ast/Type/UnionTypeNode.php
vendored
Normal file
27
vendor/phpstan/phpdoc-parser/src/Ast/Type/UnionTypeNode.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace PHPStan\PhpDocParser\Ast\Type;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\NodeAttributes;
|
||||
use function implode;
|
||||
|
||||
class UnionTypeNode implements TypeNode
|
||||
{
|
||||
|
||||
use NodeAttributes;
|
||||
|
||||
/** @var TypeNode[] */
|
||||
public $types;
|
||||
|
||||
public function __construct(array $types)
|
||||
{
|
||||
$this->types = $types;
|
||||
}
|
||||
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return '(' . implode(' | ', $this->types) . ')';
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user