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

[Console] Fix Console component $app to $this and use of getHelper() method#3994

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 1 commit intosymfony:2.5fromeko:2.5
Jul 11, 2014
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletionscomponents/console/helpers/dialoghelper.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@ functions to ask the user for more information. It is included in the default
helper set, which you can get by calling
:method:`Symfony\\Component\\Console\\Command\\Command::getHelperSet`::

$dialog = $this->getHelperSet()->get('dialog');
$dialog = $this->getHelper('dialog');

All the methods inside the Dialog Helper have an
:class:`Symfony\\Component\\Console\\Output\\OutputInterface` as the first
Expand DownExpand Up@@ -69,7 +69,7 @@ Autocompletion
You can also specify an array of potential answers for a given question. These
will be autocompleted as the user types::

$dialog = $this->getHelperSet()->get('dialog');
$dialog = $this->getHelper('dialog');
$bundleNames = array('AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle');
$name = $dialog->ask(
$output,
Expand All@@ -84,7 +84,7 @@ Hiding the User's Response
You can also ask a question and hide the response. This is particularly
convenient for passwords::

$dialog = $this->getHelperSet()->get('dialog');
$dialog = $this->getHelper('dialog');
$password = $dialog->askHiddenResponse(
$output,
'What is the database password?',
Expand DownExpand Up@@ -152,7 +152,7 @@ Validating a Hidden Response

You can also ask and validate a hidden response::

$dialog = $this->getHelperSet()->get('dialog');
$dialog = $this->getHelper('dialog');

$validator = function ($value) {
if ('' === trim($value)) {
Expand DownExpand Up@@ -186,7 +186,7 @@ Instead, you can use the
method, which makes sure that the user can only enter a valid string
from a predefined list::

$dialog = $this->getHelperSet()->get('dialog');
$dialog = $this->getHelper('dialog');
$colors = array('red', 'blue', 'yellow');

$color = $dialog->select(
Expand Down
2 changes: 1 addition & 1 deletioncomponents/console/helpers/formatterhelper.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@ The :class:`Symfony\\Component\\Console\\Helper\\FormatterHelper` is included
in the default helper set, which you can get by calling
:method:`Symfony\\Component\\Console\\Command\\Command::getHelperSet`::

$formatter = $this->getHelperSet()->get('formatter');
$formatter = $this->getHelper('formatter');

The methods return a string, which you'll usually render to the console by
passing it to the
Expand Down
2 changes: 1 addition & 1 deletioncomponents/console/helpers/progresshelper.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,7 @@ information, which updates as your command runs:
To display progress details, use the :class:`Symfony\\Component\\Console\\Helper\\ProgressHelper`,
pass it a total number of units, and advance the progress as your command executes::

$progress = $this->getHelperSet()->get('progress');
$progress = $this->getHelper('progress');

$progress->start($output, 50);
$i = 0;
Expand Down
10 changes: 5 additions & 5 deletionscomponents/console/helpers/questionhelper.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@ functions to ask the user for more information. It is included in the default
helper set, which you can get by calling
:method:`Symfony\\Component\\Console\\Command\\Command::getHelperSet`::

$helper = $this->getHelperSet()->get('question');
$helper = $this->getHelper('question');

The Question Helper has a single method
:method:`Symfony\\Component\\Console\\Command\\Command::ask` that needs an
Expand All@@ -30,7 +30,7 @@ the following to your command::
use Symfony\Component\Console\Question\ConfirmationQuestion;
// ...

$helper = $this->getHelperSet()->get('question');
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion('Continue with this action?', false);

if (!$helper->ask($input, $output, $question)) {
Expand DownExpand Up@@ -73,7 +73,7 @@ from a predefined list::
use Symfony\Component\Console\Question\ChoiceQuestion;
// ...

$helper = $app->getHelperSet()->get('question');
$helper = $this->getHelper('question');
$question = new ChoiceQuestion(
'Please select your favorite color (defaults to red)',
array('red', 'blue', 'yellow'),
Expand DownExpand Up@@ -107,7 +107,7 @@ this use :method:`Symfony\\Component\\Console\\Question\\ChoiceQuestion::setMult
use Symfony\Component\Console\Question\ChoiceQuestion;
// ...

$helper = $app->getHelperSet()->get('question');
$helper = $this->getHelper('question');
$question = new ChoiceQuestion(
'Please select your favorite color (defaults to red)',
array('red', 'blue', 'yellow'),
Expand DownExpand Up@@ -206,7 +206,7 @@ You can also use a validator with a hidden question::
use Symfony\Component\Console\Question\Question;
// ...

$helper = $this->getHelperSet()->get('question');
$helper = $this->getHelper('question');

$question = new Question('Please enter your password');
$question->setValidator(function ($value) {
Expand Down
2 changes: 1 addition & 1 deletioncomponents/console/helpers/tablehelper.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ When building a console application it may be useful to display tabular data:
To display a table, use the :class:`Symfony\\Component\\Console\\Helper\\TableHelper`,
set headers, rows and render::

$table = $this->getHelperSet()->get('table');
$table = $this->getHelper('table');
$table
->setHeaders(array('ISBN', 'Title', 'Author'))
->setRows(array(
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp