File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ defining it with the ``console.command`` tag:
61
61
->addTag('console.command')
62
62
;
63
63
64
- Use Case: Using Dependencies and Parameters to Set Default Values for Options
65
- -----------------------------------------------------------------------------
64
+ Using Dependencies and Parameters to Set Default Values for Options
65
+ -------------------------------------------------------------------
66
66
67
67
Imagine you want to provide a default value for the ``name``option. You could
68
68
pass one of the following as the 5th argument of ``addOption() ``:
@@ -111,3 +111,9 @@ constructor. The only solution is to inject them through it::
111
111
$output->writeln($name);
112
112
}
113
113
}
114
+
115
+ .. caution ::
116
+
117
+ When running the console, every commands are instanciated, which means every
118
+ ``configure() `` methods are called. Be careful with database queries, as
119
+ this could impact performances.
You can’t perform that action at this time.
0 commit comments