@@ -97,6 +97,14 @@ public static function fromEncodedByteSequence(Stringable|string $value): self
97
97
return self ::fromValue (Value::fromEncodedByteSequence ($ value ));
98
98
}
99
99
100
+ /**
101
+ * Returns a new bare instance from value.
102
+ */
103
+ private static function fromValue (Value $ value ): self
104
+ {
105
+ return new self ($ value , Parameters::create ());
106
+ }
107
+
100
108
/**
101
109
* Returns a new instance from a decoded byte sequence and an iterable of key-value parameters.
102
110
*/
@@ -152,28 +160,36 @@ public static function fromDate(DateTimeInterface $datetime): self
152
160
}
153
161
154
162
/**
155
- * Returns a new bare instance from value.
163
+ * Returns a new instance from a float value
164
+ *
165
+ * @throws SyntaxError if the format is invalid
156
166
*/
157
- private static function fromValue (Value $ value ): self
158
- {
159
- return new self ($ value , Parameters::create ());
160
- }
161
-
162
167
public static function fromDecimal (int |float $ value ): self
163
168
{
164
169
return self ::fromValue (Value::fromDecimal ($ value ));
165
170
}
166
171
172
+ /**
173
+ * Returns a new instance from an integer value
174
+ *
175
+ * @throws SyntaxError if the format is invalid
176
+ */
167
177
public static function fromInteger (int |float $ value ): self
168
178
{
169
179
return self ::fromValue (Value::fromInteger ($ value ));
170
180
}
171
181
182
+ /**
183
+ * Returns a new instance for the boolean true type
184
+ */
172
185
public static function true (): self
173
186
{
174
187
return self ::fromValue (Value::true ());
175
188
}
176
189
190
+ /**
191
+ * Returns a new instance for the boolean false type
192
+ */
177
193
public static function false (): self
178
194
{
179
195
return self ::fromValue (Value::false ());
0 commit comments