Skip to content

Commit 2839153

Browse files
committed
Revert "Cleanup"
This reverts commit 81f168c.
1 parent e41a870 commit 2839153

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+469
-1
lines changed

src/Analyser/NameScope.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,19 @@ public function hasTypeAlias(string $alias): bool
156156
return array_key_exists($alias, $this->typeAliasesMap);
157157
}
158158

159+
/**
160+
* @param mixed[] $properties
161+
*/
162+
public static function __set_state(array $properties): self
163+
{
164+
return new self(
165+
$properties['namespace'],
166+
$properties['uses'],
167+
$properties['className'],
168+
$properties['functionName'],
169+
$properties['templateTypeMap'],
170+
$properties['typeAliasesMap'],
171+
);
172+
}
173+
159174
}

src/Reflection/Native/NativeParameterReflection.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,19 @@ public function getDefaultValue(): ?Type
5050
return $this->defaultValue;
5151
}
5252

53+
/**
54+
* @param mixed[] $properties
55+
*/
56+
public static function __set_state(array $properties): self
57+
{
58+
return new self(
59+
$properties['name'],
60+
$properties['optional'],
61+
$properties['type'],
62+
$properties['passedByReference'],
63+
$properties['variadic'],
64+
$properties['defaultValue'],
65+
);
66+
}
67+
5368
}

src/Reflection/Native/NativeParameterWithPhpDocsReflection.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,21 @@ public function getDefaultValue(): ?Type
6262
return $this->defaultValue;
6363
}
6464

65+
/**
66+
* @param mixed[] $properties
67+
*/
68+
public static function __set_state(array $properties): self
69+
{
70+
return new self(
71+
$properties['name'],
72+
$properties['optional'],
73+
$properties['type'],
74+
$properties['phpDocType'],
75+
$properties['nativeType'],
76+
$properties['passedByReference'],
77+
$properties['variadic'],
78+
$properties['defaultValue'],
79+
);
80+
}
81+
6582
}

src/Reflection/PassedByReference.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,12 @@ public function combine(self $other): self
7474
return $this;
7575
}
7676

77+
/**
78+
* @param mixed[] $properties
79+
*/
80+
public static function __set_state(array $properties): self
81+
{
82+
return new self($properties['value']);
83+
}
84+
7785
}

src/TrinaryLogic.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,12 @@ public function describe(): string
142142
return $labels[$this->value];
143143
}
144144

145+
/**
146+
* @param mixed[] $properties
147+
*/
148+
public static function __set_state(array $properties): self
149+
{
150+
return self::create($properties['value']);
151+
}
152+
145153
}

src/Type/Accessory/AccessoryLiteralStringType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,9 @@ public function generalize(GeneralizePrecision $precision): Type
192192
return new StringType();
193193
}
194194

195+
public static function __set_state(array $properties): Type
196+
{
197+
return new self();
198+
}
199+
195200
}

src/Type/Accessory/AccessoryNonEmptyStringType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,9 @@ public function generalize(GeneralizePrecision $precision): Type
188188
return new StringType();
189189
}
190190

191+
public static function __set_state(array $properties): Type
192+
{
193+
return new self();
194+
}
195+
191196
}

src/Type/Accessory/AccessoryNumericStringType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,9 @@ public function generalize(GeneralizePrecision $precision): Type
187187
return new StringType();
188188
}
189189

190+
public static function __set_state(array $properties): Type
191+
{
192+
return new self();
193+
}
194+
190195
}

src/Type/Accessory/HasMethodType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,9 @@ public function traverse(callable $cb): Type
137137
return $this;
138138
}
139139

140+
public static function __set_state(array $properties): Type
141+
{
142+
return new self($properties['methodName']);
143+
}
144+
140145
}

src/Type/Accessory/HasOffsetType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,9 @@ public function traverse(callable $cb): Type
186186
return $this;
187187
}
188188

189+
public static function __set_state(array $properties): Type
190+
{
191+
return new self($properties['offsetType']);
192+
}
193+
189194
}

0 commit comments

Comments
 (0)