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

Appearance settings

Commit 120a7e9

Browse filesBrowse files
committed
bug #10443 [FrameworkBundle] Use DIC parameter as default host value if available (romainneutron)
This PR was merged into the 2.5-dev branch. Discussion ---------- [FrameworkBundle] Use DIC parameter as default host value if available | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT This follows #10439 Commits ------- 85a2fbf [FrameworkBundle] Use DIC parameter as default host value if available
2 parents b7c158a + 85a2fbf commit 120a7e9
Copy full SHA for 120a7e9

File tree

Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ protected function configure()
5151
->setName('router:match')
5252
->setDefinition(array(
5353
new InputArgument('path_info', InputArgument::REQUIRED, 'A path info'),
54-
new InputOption('method', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP method', 'GET'),
55-
new InputOption('host', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP host', 'localhost'),
54+
new InputOption('method', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP method'),
55+
new InputOption('host', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP host'),
5656
))
5757
->setDescription('Helps debug routes by simulating a path info match')
5858
->setHelp(<<<EOF
@@ -74,8 +74,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
7474
{
7575
$router = $this->getContainer()->get('router');
7676
$context = $router->getContext();
77-
$context->setMethod($input->getOption('method'));
78-
$context->setHost($input->getOption('host'));
77+
if (null !== $method = $input->getOption('method')) {
78+
$context->setMethod($method);
79+
}
80+
if (null !== $host = $input->getOption('host')) {
81+
$context->setHost($host);
82+
}
7983

8084
$matcher = new TraceableUrlMatcher($router->getRouteCollection(), $context);
8185

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.