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
thrownewLogicException(\sprintf('The parameter "$%s" must have a named type. Untyped, Union or Intersection types are not supported for command arguments.', $name));
66
+
thrownewLogicException(\sprintf('The parameter "$%s" of "%s()" must have a named type. Untyped, Union or Intersection types are not supported for command arguments.', $name, $self->function));
60
67
}
61
68
62
69
$parameterTypeName = $type->getName();
63
70
64
71
if (!\in_array($parameterTypeName, self::ALLOWED_TYPES, true)) {
65
-
thrownewLogicException(\sprintf('The type "%s" of parameter "$%s" is not supported as a command argument. Only "%s" types are allowed.', $parameterTypeName, $name, implode('", "', self::ALLOWED_TYPES)));
72
+
thrownewLogicException(\sprintf('The type "%s" on parameter "$%s" of "%s()" is not supported as a command argument. Only "%s" types are allowed.', $parameterTypeName, $name, $self->function, implode('", "', self::ALLOWED_TYPES)));
thrownewLogicException(\sprintf('The option parameter "$%s" must declare a default value.', $name));
71
+
thrownewLogicException(\sprintf('The option parameter "$%s" of "%s()" must declare a default value.', $name, $self->function));
65
72
}
66
73
67
74
if (!$self->name) {
@@ -76,21 +83,21 @@ public static function tryFrom(\ReflectionParameter $parameter): ?self
76
83
}
77
84
78
85
if (!$typeinstanceof \ReflectionNamedType) {
79
-
thrownewLogicException(\sprintf('The parameter "$%s" must have a named type. Untyped or Intersection types are not supported for command options.', $name));
86
+
thrownewLogicException(\sprintf('The parameter "$%s" of "%s()" must have a named type. Untyped or Intersection types are not supported for command options.', $name, $self->function));
80
87
}
81
88
82
89
$self->typeName = $type->getName();
83
90
84
91
if (!\in_array($self->typeName, self::ALLOWED_TYPES, true)) {
85
-
thrownewLogicException(\sprintf('The type "%s" of parameter "$%s" is not supported as a command option. Only "%s" types are allowed.', $self->typeName, $name, implode('", "', self::ALLOWED_TYPES)));
92
+
thrownewLogicException(\sprintf('The type "%s" on parameter "$%s" of "%s()" is not supported as a command option. Only "%s" types are allowed.', $self->typeName, $name, $self->function, implode('", "', self::ALLOWED_TYPES)));
thrownewLogicException(\sprintf('The option parameter "$%s" must not be nullable when it has a default boolean value.', $name));
96
+
thrownewLogicException(\sprintf('The option parameter "$%s" of "%s()" must not be nullable when it has a default boolean value.', $name, $self->function));
90
97
}
91
98
92
99
if ($self->allowNull && null !== $self->default) {
93
-
thrownewLogicException(\sprintf('The option parameter "$%s" must either be not-nullable or have a default of null.', $name));
100
+
thrownewLogicException(\sprintf('The option parameter "$%s" of "%s()" must either be not-nullable or have a default of null.', $name, $self->function));
94
101
}
95
102
96
103
if ('bool' === $self->typeName) {
@@ -160,11 +167,11 @@ private function handleUnion(\ReflectionUnionType $type): self
if (!\in_array($this->typeName, self::ALLOWED_UNION_TYPES, true)) {
163
-
thrownewLogicException(\sprintf('The union type for parameter "$%s" is not supported as a command option. Only "%s" types are allowed.', $this->name, implode('", "', self::ALLOWED_UNION_TYPES)));
170
+
thrownewLogicException(\sprintf('The union type for parameter "$%s" of "%s()" is not supported as a command option. Only "%s" types are allowed.', $this->name, $this->function, implode('", "', self::ALLOWED_UNION_TYPES)));
164
171
}
165
172
166
173
if (false !== $this->default) {
167
-
thrownewLogicException(\sprintf('The option parameter "$%s" must have a default value of false.', $this->name));
174
+
thrownewLogicException(\sprintf('The option parameter "$%s" of "%s()" must have a default value of false.', $this->name, $this->function));
$this->expectExceptionMessage('The type "object" of parameter "$any" is not supported as a command argument. Only "string", "bool", "int", "float", "array" types are allowed.');
142
141
143
142
$command->getDefinition();
144
143
}
@@ -149,7 +148,6 @@ public function testInvalidOptionType()
$this->expectExceptionMessage('The type "object" of parameter "$any" is not supported as a command option. Only "string", "bool", "int", "float", "array" types are allowed.');
153
151
154
152
$command->getDefinition();
155
153
}
@@ -322,54 +320,44 @@ public static function provideNonBinaryInputOptions(): \Generator
0 commit comments