-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Cannot set a default value when using InputOption::VALUE_NONE mode #51
Comments
@mnapoli am i using something wrong, or just not compatible with symfony 4.2? |
downgraded
i'm not able to downgrade further with |
had to downgrade to 1.5 for error to go away:
|
i'm able to avoid the error by renaming the option: ➔ git diff
diff --git a/MailDownloadCommand.php b/MailDownloadCommand.php
index c4de6d7..1a4412e 100644
--- a/MailDownloadCommand.php
+++ b/MailDownloadCommand.php
@@ -16,7 +16,7 @@ namespace Eventum\Console\Command;
class MailDownloadCommand
{
const DEFAULT_COMMAND = 'mail:download';
- const USAGE = self::DEFAULT_COMMAND . ' [username] [hostname] [mailbox] [--limit=] [--no-lock]';
+ const USAGE = self::DEFAULT_COMMAND . ' [username] [hostname] [mailbox] [--limit=] [--nolock]';
/**
* @param string $username but this would be backwards incompatible change for the application.
|
removing default value for ➔ ./test.php
array:5 [
"username" => null
"hostname" => null
"mailbox" => null
"limit" => 0
"no-lock" => false
]
➔ ./test.php --no-lock
array:5 [
"username" => null
"hostname" => null
"mailbox" => null
"limit" => 0
"no-lock" => true
]
➔ git diff
diff --git a/MailDownloadCommand.php b/MailDownloadCommand.php
index c4de6d7..65246a2 100644
--- a/MailDownloadCommand.php
+++ b/MailDownloadCommand.php
@@ -22,10 +22,10 @@ class MailDownloadCommand
* @param string $username
* @param string $hostname
* @param string $mailbox
- * @param int $limit
* @param bool $noLock
+ * @param int $limit
*/
- public function execute($username, $hostname, $mailbox, $limit = 0, $noLock = false)
+ public function execute($username, $hostname, $mailbox, $noLock, $limit = 0)
{
dump([
'username' => $username,
➔ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
seems to be issue with symfony 4.2:
Reproducer: https://gist.github.com/glensc/b28386f361db58f3c436e7b79460983b
tag v1 shows the problem:
The text was updated successfully, but these errors were encountered: