Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Ast/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ public function getReformattedText(): string
return trim($this->text);
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
return new self($properties['text'], $properties['startLine'], $properties['startIndex']);
}

}
14 changes: 14 additions & 0 deletions src/Ast/ConstExpr/ConstExprArrayItemNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,18 @@ public function __toString(): string
return (string) $this->value;
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['key'], $properties['value']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/ConstExpr/ConstExprArrayNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,18 @@ public function __toString(): string
return '[' . implode(', ', $this->items) . ']';
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['items']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/ConstExpr/ConstExprFalseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,18 @@ public function __toString(): string
return 'false';
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self();
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/ConstExpr/ConstExprFloatNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,18 @@ public function __toString(): string
return $this->value;
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['value']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/ConstExpr/ConstExprIntegerNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,18 @@ public function __toString(): string
return $this->value;
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['value']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/ConstExpr/ConstExprNullNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,18 @@ public function __toString(): string
return 'null';
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self();
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/ConstExpr/ConstExprStringNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,18 @@ private function escapeDoubleQuotedString(): string
}, $escaped);
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['value'], $properties['quoteType']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/ConstExpr/ConstExprTrueNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,18 @@ public function __toString(): string
return 'true';
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self();
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/ConstExpr/ConstFetchNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,18 @@ public function __toString(): string
return "{$this->className}::{$this->name}";
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['className'], $properties['name']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/ConstExpr/DoctrineConstExprStringNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,18 @@ private static function escape(string $value): string
return sprintf('"%s"', str_replace('"', '""', $value));
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['value']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/AssertTagMethodValueNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,18 @@ public function __toString(): string
return trim("{$isNegated}{$isEquality}{$this->type} {$this->parameter}->{$this->method}() {$this->description}");
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['type'], $properties['parameter'], $properties['method'], $properties['isNegated'], $properties['description'], $properties['isEquality']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/AssertTagPropertyValueNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,18 @@ public function __toString(): string
return trim("{$isNegated}{$isEquality}{$this->type} {$this->parameter}->{$this->property} {$this->description}");
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['type'], $properties['parameter'], $properties['property'], $properties['isNegated'], $properties['description'], $properties['isEquality']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/AssertTagValueNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,18 @@ public function __toString(): string
return trim("{$isNegated}{$isEquality}{$this->type} {$this->parameter} {$this->description}");
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['type'], $properties['parameter'], $properties['isNegated'], $properties['description'], $properties['isEquality']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/DeprecatedTagValueNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,18 @@ public function __toString(): string
return trim($this->description);
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['description']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,18 @@ public function __toString(): string
return $this->name . '(' . $arguments . ')';
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['name'], $properties['arguments']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/Doctrine/DoctrineArgument.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,18 @@ public function __toString(): string
return $this->key . '=' . $this->value;
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['key'], $properties['value']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/Doctrine/DoctrineArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,18 @@ public function __toString(): string
return '{' . $items . '}';
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['items']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,18 @@ public function __toString(): string
return $this->key . '=' . $this->value;
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['key'], $properties['value']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,18 @@ public function __toString(): string
return trim("{$this->annotation} {$this->description}");
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['annotation'], $properties['description']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/ExtendsTagValueNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,18 @@ public function __toString(): string
return trim("{$this->type} {$this->description}");
}

/**
* @param array<string, mixed> $properties
*/
public static function __set_state(array $properties): self
{
$instance = new self($properties['type'], $properties['description']);
if (isset($properties['attributes'])) {
foreach ($properties['attributes'] as $key => $value) {
$instance->setAttribute($key, $value);
}
}
return $instance;
}

}
Loading
Loading