-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Improve #[Argument]
/#[Option]
exception messages
#60447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 7.3
Are you sure you want to change the base?
Conversation
The exception messages now include the method: > The option parameter "$a" of "App\Command\SendSalesReportsCommand::__invoke()" must declare a default value.
@kbond it seems tests failures are related |
Ak, indeed, I'll get them fixed |
@@ -27,6 +27,8 @@ | |||
|
|||
class InvokableCommandTest extends TestCase | |||
{ | |||
private const FUNCTION_NAME = 'Symfony\Component\Console\Tests\Command\InvokableCommandTest::Symfony\Component\Console\Tests\Command\{closure}()'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the 2 namespaces? It should be Symfony\Component\Console\Tests\Command\InvokableCommandTest\{closure}()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the code to extract the function name from
if (($function = $parameter->getDeclaringFunction()) instanceof \ReflectionMethod) { |
For invokable classes, which most of these new commands will be in practice, the name looks like you expect: App\Command\SendSalesReportsCommand::__invoke()
Includes the class/method in
#[Argument]
/#[Option]
exception messages.Example