Skip to content

Commit ff8d544

Browse files
committed
Merge branch '2.4'
* 2.4: [Debug] fixed unit tests Avoid notice from being *eaten* by fatal error. Teardown used wrong property Modified guessDefaultEscapingStrategy to not escape txt templates Fix DateType for 32bits computers. Fixed the registration of validation.xml file when the form is disabled fixed lexing expression ending with spaces Fixes #9633, Removed dependency to Symfony\Bundle\FrameworkBundle\Tests\TestCase [Validator] Replaced inexistent interface. [HttpKernel] Fix profiler event-listener usage outside request stack context When getting the session's id, check if the session is not closed Fix undefined offset when formatting namespace suggestions Adjusting CacheClear Warmup method to namespaced kernels
2 parents b10f476 + 3c1496a commit ff8d544

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ public function findNamespace($namespace)
515515
}
516516

517517
$exact = in_array($namespace, $namespaces, true);
518-
if (1 < count($namespaces) && !$exact) {
519-
throw new \InvalidArgumentException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions($namespaces)));
518+
if (count($namespaces) > 1 && !$exact) {
519+
throw new \InvalidArgumentException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))));
520520
}
521521

522522
return $exact ? $namespace : reset($namespaces);

Tests/ApplicationTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public static function setUpBeforeClass()
4444
require_once self::$fixturesPath.'/Foo4Command.php';
4545
require_once self::$fixturesPath.'/Foo5Command.php';
4646
require_once self::$fixturesPath.'/FoobarCommand.php';
47+
require_once self::$fixturesPath.'/BarBucCommand.php';
4748
}
4849

4950
protected function normalizeLineBreaks($text)
@@ -207,6 +208,7 @@ public function testFindNamespace()
207208
public function testFindAmbiguousNamespace()
208209
{
209210
$application = new Application();
211+
$application->add(new \BarBucCommand());
210212
$application->add(new \FooCommand());
211213
$application->add(new \Foo2Command());
212214
$application->findNamespace('f');

Tests/Fixtures/BarBucCommand.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
use Symfony\Component\Console\Command\Command;
4+
5+
class BarBucCommand extends Command
6+
{
7+
protected function configure()
8+
{
9+
$this->setName('bar:buc');
10+
}
11+
}

0 commit comments

Comments
 (0)