Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lib
unicaen
code
Commits
3d70e833
Commit
3d70e833
authored
8 months ago
by
Laurent Lecluse
Browse files
Options
Downloads
Patches
Plain Diff
template utilisable + facilement
parent
c6d0eb87
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#32094
passed
8 months ago
Stage: publish
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/template/Command.php
+8
-13
8 additions, 13 deletions
code/template/Command.php
with
8 additions
and
13 deletions
code/template/Command.php
+
8
−
13
View file @
3d70e833
...
...
@@ -5,6 +5,7 @@ namespace <namespace>;
use
Symfony\Component\Console\Command\Command
as
SymfonyCommand
;
use
Symfony\Component\Console\Input\InputInterface
;
use
Symfony\Component\Console\Output\OutputInterface
;
use
Symfony\Component\Console\Style\SymfonyStyle
;
/**
* Description of <classname>
...
...
@@ -13,23 +14,17 @@ use Symfony\Component\Console\Output\OutputInterface;
*/
class
<
classname
>
extends
SymfonyCommand
{
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
):
int
protected
function
configure
():
void
{
// ... put here the code to create the user
$this
->
setDescription
(
'... description à adapter ...'
);
}
// this method must return an integer number with the "exit status code"
// of the command. You can also use these constants to make code more readable
// return this if there was no problem running the command
// (it's equivalent to returning int(0))
return
SymfonyCommand
::
SUCCESS
;
// or return this if some error happened during the execution
// (it's equivalent to returning int(1))
// return Command::FAILURE
;
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
):
int
{
$io
=
new
SymfonyStyle
(
$input
,
$output
)
;
// or return this to indicate incorrect command usage; e.g. invalid options
// or missing arguments (it's equivalent to returning int(2))
// return Command::INVALID
return
SymfonyCommand
::
SUCCESS
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment