Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf4503b6

Browse files
committed
[Console] RunInvokableCommand viaexecute() method.
1 parent76ab38f commitf4503b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/Symfony/Component/Console/Command/Command.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,16 @@ protected function configure()
214214
*
215215
* @return int 0 if everything went fine, or an exit code
216216
*
217-
* @throws LogicException When this abstract method is not implemented
217+
* @throws LogicException When this abstract method is not implemented or doesn't implement InvokableCommand
218218
*
219219
* @see setCode()
220220
*/
221221
protectedfunctionexecute(InputInterface$input,OutputInterface$output):int
222222
{
223+
if ($this->code) {
224+
return ($this->code)($input,$output);
225+
}
226+
223227
thrownewLogicException('You must override the execute() method in the concrete command class.');
224228
}
225229

@@ -311,10 +315,6 @@ public function run(InputInterface $input, OutputInterface $output): int
311315

312316
$input->validate();
313317

314-
if ($this->code) {
315-
return ($this->code)($input,$output);
316-
}
317-
318318
return$this->execute($input,$output);
319319
}
320320

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp