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

Commit6eaaf28

Browse files
committed
[FrameworkBundle][WebServerBundle] Use SymfonyStyle::getErrorStyle() in commands
1 parentd94da86 commit6eaaf28

File tree

14 files changed

+16
-26
lines changed

14 files changed

+16
-26
lines changed

‎src/Symfony/Bridge/Twig/Command/LintCommand.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
useSymfony\Component\Console\Input\InputInterface;
1717
useSymfony\Component\Console\Input\InputOption;
1818
useSymfony\Component\Console\Output\OutputInterface;
19-
useSymfony\Component\Console\Output\ConsoleOutputInterface;
2019
useSymfony\Component\Console\Style\SymfonyStyle;
2120
useSymfony\Component\Finder\Finder;
2221

@@ -89,8 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8988
$io =newSymfonyStyle($input,$output);
9089

9190
if (null ===$twig =$this->getTwigEnvironment()) {
92-
$errorIo =$outputinstanceof ConsoleOutputInterface ?newSymfonyStyle($input,$output->getErrorOutput()) :$io;
93-
$errorIo->error('The Twig environment needs to be set.');
91+
$io->getErrorStyle()->error('The Twig environment needs to be set.');
9492

9593
return1;
9694
}

‎src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
useSymfony\Component\Console\Input\InputArgument;
1616
useSymfony\Component\Console\Input\InputInterface;
1717
useSymfony\Component\Console\Output\OutputInterface;
18-
useSymfony\Component\Console\Output\ConsoleOutputInterface;
1918
useSymfony\Component\Console\Style\SymfonyStyle;
2019
useSymfony\Component\Console\Exception\LogicException;
2120
useSymfony\Component\Yaml\Yaml;
@@ -63,7 +62,7 @@ protected function configure()
6362
protectedfunctionexecute(InputInterface$input,OutputInterface$output)
6463
{
6564
$io =newSymfonyStyle($input,$output);
66-
$errorIo =$outputinstanceof ConsoleOutputInterface ?newSymfonyStyle($input,$output->getErrorOutput()) :$io;
65+
$errorIo =$io->getErrorStyle();
6766

6867
if (null ===$name =$input->getArgument('name')) {
6968
$this->listBundles($errorIo);

‎src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
useSymfony\Component\Console\Input\InputOption;
1818
useSymfony\Component\Console\Input\InputInterface;
1919
useSymfony\Component\Console\Output\OutputInterface;
20-
useSymfony\Component\Console\Output\ConsoleOutputInterface;
2120
useSymfony\Component\Console\Style\SymfonyStyle;
2221

2322
/**
@@ -71,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7170
$io =newSymfonyStyle($input,$output);
7271

7372
if (null ===$name =$input->getArgument('name')) {
74-
$errorIo =$outputinstanceof ConsoleOutputInterface ?newSymfonyStyle($input,$output->getErrorOutput()) :$io;
73+
$errorIo =$io->getErrorStyle();
7574
$this->listBundles($errorIo);
7675
$errorIo->comment('Provide the name of a bundle as the first argument of this command to dump its default configuration. (e.g. <comment>config:dump-reference FrameworkBundle</comment>)');
7776

‎src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
useSymfony\Component\Console\Input\InputOption;
1717
useSymfony\Component\Console\Input\InputInterface;
1818
useSymfony\Component\Console\Output\OutputInterface;
19-
useSymfony\Component\Console\Output\ConsoleOutputInterface;
2019
useSymfony\Component\Console\Style\SymfonyStyle;
2120
useSymfony\Component\DependencyInjection\Loader\XmlFileLoader;
2221
useSymfony\Component\DependencyInjection\ContainerBuilder;
@@ -94,7 +93,7 @@ protected function configure()
9493
protectedfunctionexecute(InputInterface$input,OutputInterface$output)
9594
{
9695
$io =newSymfonyStyle($input,$output);
97-
$errorIo =$outputinstanceof ConsoleOutputInterface ?newSymfonyStyle($input,$output->getErrorOutput()) :$io;
96+
$errorIo =$io->getErrorStyle();
9897

9998
$this->validateInput($input);
10099
$object =$this->getContainerBuilder();

‎src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
useSymfony\Component\Console\Input\InputOption;
1717
useSymfony\Component\Console\Input\InputInterface;
1818
useSymfony\Component\Console\Output\OutputInterface;
19-
useSymfony\Component\Console\Output\ConsoleOutputInterface;
2019
useSymfony\Component\Console\Style\SymfonyStyle;
2120
useSymfony\Component\EventDispatcher\EventDispatcherInterface;
2221

@@ -66,8 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6665
$options =array();
6766
if ($event =$input->getArgument('event')) {
6867
if (!$dispatcher->hasListeners($event)) {
69-
$errorIo =$outputinstanceof ConsoleOutputInterface ?newSymfonyStyle($input,$output->getErrorOutput()) :$io;
70-
$errorIo->warning(sprintf('The event "%s" does not have any registered listeners.',$event));
68+
$io->getErrorStyle()->warning(sprintf('The event "%s" does not have any registered listeners.',$event));
7169

7270
return;
7371
}

‎src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespaceSymfony\Bundle\FrameworkBundle\Command;
1313

1414
useSymfony\Bundle\FrameworkBundle\Translation\TranslationLoader;
15-
useSymfony\Component\Console\Output\ConsoleOutputInterface;
1615
useSymfony\Component\Console\Style\SymfonyStyle;
1716
useSymfony\Component\Console\Input\InputInterface;
1817
useSymfony\Component\Console\Input\InputArgument;
@@ -160,8 +159,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
160159
$outputMessage .=sprintf(' and domain "%s"',$domain);
161160
}
162161

163-
$errorIo =$outputinstanceof ConsoleOutputInterface ?newSymfonyStyle($input,$output->getErrorOutput()) :$io;
164-
$errorIo->warning($outputMessage);
162+
$io->getErrorStyle()->warning($outputMessage);
165163

166164
return;
167165
}

‎src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespaceSymfony\Bundle\FrameworkBundle\Command;
1313

14-
useSymfony\Component\Console\Output\ConsoleOutputInterface;
1514
useSymfony\Component\Console\Style\SymfonyStyle;
1615
useSymfony\Component\Translation\Catalogue\TargetOperation;
1716
useSymfony\Component\Translation\Catalogue\MergeOperation;
@@ -86,7 +85,7 @@ public function isEnabled()
8685
protectedfunctionexecute(InputInterface$input,OutputInterface$output)
8786
{
8887
$io =newSymfonyStyle($input,$output);
89-
$errorIo =$outputinstanceof ConsoleOutputInterface ?newSymfonyStyle($input,$output->getErrorOutput()) :$io;
88+
$errorIo =$io->getErrorStyle();
9089

9190
// check presence of force or dump-message
9291
if ($input->getOption('force') !==true &&$input->getOption('dump-messages') !==true) {

‎src/Symfony/Bundle/FrameworkBundle/composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"require-dev": {
3535
"symfony/asset":"~2.8|~3.0",
3636
"symfony/browser-kit":"~2.8|~3.0",
37-
"symfony/console":"~2.8.8|~3.0.8|~3.1.2|~3.2",
37+
"symfony/console":"~3.3",
3838
"symfony/css-selector":"~2.8|~3.0",
3939
"symfony/dom-crawler":"~2.8|~3.0",
4040
"symfony/polyfill-intl-icu":"~1.0",

‎src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
useSymfony\Component\Console\Input\InputArgument;
1616
useSymfony\Component\Console\Input\InputInterface;
1717
useSymfony\Component\Console\Input\InputOption;
18-
useSymfony\Component\Console\Output\ConsoleOutputInterface;
1918
useSymfony\Component\Console\Output\OutputInterface;
2019
useSymfony\Component\Console\Question\Question;
2120
useSymfony\Component\Console\Style\SymfonyStyle;
@@ -86,7 +85,7 @@ protected function configure()
8685
protectedfunctionexecute(InputInterface$input,OutputInterface$output)
8786
{
8887
$io =newSymfonyStyle($input,$output);
89-
$errorIo =$outputinstanceof ConsoleOutputInterface ?newSymfonyStyle($input,$output->getErrorOutput()) :$io;
88+
$errorIo =$io->getErrorStyle();
9089

9190
$input->isInteractive() ?$errorIo->title('Symfony Password Encoder Utility') :$errorIo->newLine();
9291

‎src/Symfony/Bundle/SecurityBundle/composer.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"require-dev": {
2626
"symfony/asset":"~2.8|~3.0",
2727
"symfony/browser-kit":"~2.8|~3.0",
28-
"symfony/console":"~2.8|~3.0",
28+
"symfony/console":"~3.3",
2929
"symfony/css-selector":"~2.8|~3.0",
3030
"symfony/dom-crawler":"~2.8|~3.0",
3131
"symfony/form":"~2.8|~3.0",
@@ -44,7 +44,8 @@
4444
"twig/twig":"~1.28|~2.0"
4545
},
4646
"suggest": {
47-
"symfony/security-acl":"For using the ACL functionality of this bundle"
47+
"symfony/security-acl":"For using the ACL functionality of this bundle",
48+
"symfony/console":"For using the console commands"
4849
},
4950
"autoload": {
5051
"psr-4": {"Symfony\\Bundle\\SecurityBundle\\":"" },

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp