You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$this->expectExceptionMessage(\sprintf('The type "object" on parameter "$any" of "%s" is not supported as a command argument. Only "string", "bool", "int", "float", "array" types are allowed.', self::FUNCTION_NAME));
144
141
145
142
$command->getDefinition();
146
143
}
@@ -151,7 +148,6 @@ public function testInvalidOptionType()
$this->expectExceptionMessage(\sprintf('The type "object" on parameter "$any" of "%s" is not supported as a command option. Only "string", "bool", "int", "float", "array" types are allowed.', self::FUNCTION_NAME));
155
151
156
152
$command->getDefinition();
157
153
}
@@ -324,54 +320,44 @@ public static function provideNonBinaryInputOptions(): \Generator
\sprintf('The option parameter "$a" of "%s" must declare a default value.', self::FUNCTION_NAME),
336
+
function (#[Option] string$a) {}
343
337
];
344
338
yield'nullable-bool-default-true' => [
345
-
function (#[Option] ?bool$a = true) {},
346
-
\sprintf('The option parameter "$a" of "%s" must not be nullable when it has a default boolean value.', self::FUNCTION_NAME),
339
+
function (#[Option] ?bool$a = true) {}
347
340
];
348
341
yield'nullable-bool-default-false' => [
349
-
function (#[Option] ?bool$a = false) {},
350
-
\sprintf('The option parameter "$a" of "%s" must not be nullable when it has a default boolean value.', self::FUNCTION_NAME),
342
+
function (#[Option] ?bool$a = false) {}
351
343
];
352
344
yield'invalid-union-type' => [
353
-
function (#[Option] array|bool$a = false) {},
354
-
\sprintf('The union type for parameter "$a" of "%s" is not supported as a command option. Only "bool|string", "bool|int", "bool|float" types are allowed.', self::FUNCTION_NAME),
345
+
function (#[Option] array|bool$a = false) {}
355
346
];
356
347
yield'union-type-cannot-allow-null' => [
357
348
function (#[Option] string|bool|null$a = null) {},
358
-
\sprintf('The union type for parameter "$a" of "%s" is not supported as a command option. Only "bool|string", "bool|int", "bool|float" types are allowed.', self::FUNCTION_NAME),
359
349
];
360
350
yield'union-type-default-true' => [
361
351
function (#[Option] string|bool$a = true) {},
362
-
\sprintf('The option parameter "$a" of "%s" must have a default value of false.', self::FUNCTION_NAME),
363
352
];
364
353
yield'union-type-default-string' => [
365
354
function (#[Option] string|bool$a = 'foo') {},
366
-
\sprintf('The option parameter "$a" of "%s" must have a default value of false.', self::FUNCTION_NAME),
367
355
];
368
356
yield'nullable-string-not-null-default' => [
369
357
function (#[Option] ?string$a = 'foo') {},
370
-
\sprintf('The option parameter "$a" of "%s" must either be not-nullable or have a default of null.', self::FUNCTION_NAME),
371
358
];
372
359
yield'nullable-array-not-null-default' => [
373
360
function (#[Option] ?array$a = []) {},
374
-
\sprintf('The option parameter "$a" of "%s" must either be not-nullable or have a default of null.', self::FUNCTION_NAME),
0 commit comments